MCPcopy
hub / github.com/openai/openai-python / send

Method send

src/openai/resources/responses/responses.py:4295–4308  ·  view source on GitHub ↗
(self, event: ResponsesClientEvent | ResponsesClientEventParam)

Source from the content-addressed store, hash-verified

4293 return message
4294
4295 def send(self, event: ResponsesClientEvent | ResponsesClientEventParam) -> None:
4296 data = (
4297 event.to_json(use_api_names=True, exclude_defaults=True, exclude_unset=True)
4298 if isinstance(event, BaseModel)
4299 else json.dumps(maybe_transform(event, ResponsesClientEventParam))
4300 )
4301 if self._is_reconnecting:
4302 self._send_queue.enqueue(data)
4303 return
4304 try:
4305 self._connection.send(data)
4306 except Exception:
4307 self._send_queue.enqueue(data)
4308 raise
4309
4310 def send_raw(self, data: bytes | str) -> None:
4311 if self._is_reconnecting:

Callers 7

sendMethod · 0.45
send_rawMethod · 0.45
_sendMethod · 0.45
send_rawMethod · 0.45
_flush_send_queueMethod · 0.45
createMethod · 0.45
createMethod · 0.45

Calls 3

maybe_transformFunction · 0.85
to_jsonMethod · 0.80
enqueueMethod · 0.80

Tested by

no test coverage detected