Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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