Enhance WebSocket session management by requiring assistant_id as a query parameter for connection. Update API reference documentation to reflect changes in message flow and metadata validation rules, including the introduction of whitelists for allowed metadata fields and restrictions on sensitive keys. Refactor client examples to align with the new session initiation process.
This commit is contained in:
@@ -157,16 +157,16 @@ class HttpBackendAdapter:
|
||||
async with session.get(url) as resp:
|
||||
if resp.status == 404:
|
||||
logger.warning(f"Assistant config not found: {assistant_id}")
|
||||
return None
|
||||
return {"__error_code": "assistant.not_found", "assistantId": assistant_id}
|
||||
resp.raise_for_status()
|
||||
payload = await resp.json()
|
||||
if not isinstance(payload, dict):
|
||||
logger.warning("Assistant config payload is not a dict; ignoring")
|
||||
return None
|
||||
return {"__error_code": "assistant.config_unavailable", "assistantId": assistant_id}
|
||||
return payload
|
||||
except Exception as exc:
|
||||
logger.warning(f"Failed to fetch assistant config ({assistant_id}): {exc}")
|
||||
return None
|
||||
return {"__error_code": "assistant.config_unavailable", "assistantId": assistant_id}
|
||||
|
||||
async def create_call_record(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user