Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -1971,7 +1971,8 @@ def _parse_response_from_openai(
metadata: dict[str, Any] = response.metadata or {}
contents: list[Content] = []
local_shell_tool_name = self._get_local_shell_tool_name(options.get("tools"))
for item in response.output: # type: ignore[reportUnknownMemberType]
response_outputs = cast(list[Any], getattr(response, "output", None) or [])
for item in response_outputs:
match item.type:
# types:
# ParsedResponseOutputMessage[Unknown] |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -788,13 +788,13 @@ def _parse_text_from_openai(self, choice: Choice | ChunkChoice) -> Content | Non
def _get_metadata_from_chat_response(self, response: ChatCompletion) -> dict[str, Any]:
"""Get metadata from a chat response."""
return {
"system_fingerprint": response.system_fingerprint,
"system_fingerprint": getattr(response, "system_fingerprint", None),
Comment thread
eavanvalkenburg marked this conversation as resolved.
}

def _get_metadata_from_streaming_chat_response(self, response: ChatCompletionChunk) -> dict[str, Any]:
"""Get metadata from a streaming chat response."""
return {
"system_fingerprint": response.system_fingerprint,
"system_fingerprint": getattr(response, "system_fingerprint", None),
Comment thread
eavanvalkenburg marked this conversation as resolved.
}

def _get_metadata_from_chat_choice(self, choice: Choice | ChunkChoice) -> dict[str, Any]:
Expand Down
Loading