Skip to content

Add new OpenAI GPT-5 models #2503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

medaminezghal
Copy link
Contributor

This will add new OpenAI GPT-5 models and fix tests related to openai>=1.99.3.

This PR is a fix for this PR.

@@ -416,6 +420,7 @@ def _process_response(self, response: chat.ChatCompletion | str) -> ModelRespons
items.extend(split_content_into_text_and_thinking(choice.message.content, self.profile.thinking_tags))
if choice.message.tool_calls is not None:
for c in choice.message.tool_calls:
c = cast(ChatCompletionMessageFunctionToolCall, c)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't be doing this. What is the type of c?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kludex the choice.message.tool_calls has the type of ChatCompletionMessageToolCall which is

ChatCompletionMessageToolCall: TypeAlias = Annotated[
    Union[ChatCompletionMessageFunctionToolCall, ChatCompletionMessageCustomToolCall],
    PropertyInfo(discriminator="type"),
]

that's why I use cast.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants