Trying to dump call list to json with this snippet
import os
from dotenv import load_dotenv
from retell import Retell
from retell.types import CallResponse, PhoneCallResponse, WebCallResponse, CallListResponse
load_dotenv()
retell_api_key = os.getenv("RETELL_API_KEY")
retell_agent_id = os.getenv("RETELL_AGENT_ID")
call_list_path = "data/call_list.json"
client = Retell(
api_key=retell_api_key,
)
call_list: CallListResponse = client.call.list()
with open(call_list_path, "w") as json_file:
for call in call_list:
json_file.write(call.model_dump_json(indent=4))
print(f"Call list saved to {call_list_path}")
I get the error
Traceback (most recent call last):
File "main.py", line 22, in <module>
json_file.write(call.model_dump_json(indent=4))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".venv/lib/python3.12/site-packages/pydantic/main.py", line 477, in model_dump_json
return self.__pydantic_serializer__.to_json(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.PydanticSerializationError: Error serializing to JSON: TypeError: 'MockValSer' object cannot be converted to 'SchemaSerializer'
Version:
retell-sdk-4.13.0
Python 3.12.7
Trying to dump call list to json with this snippet
I get the error
Version:
retell-sdk-4.13.0
Python 3.12.7