Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: convert litellm response with reasoning content to openai message#1098

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
zkllll2002 wants to merge2 commits intoopenai:main
base:main
Choose a base branch
Loading
fromzkllll2002:fix/reasoning-content

Conversation

zkllll2002
Copy link

1. Description

This PR fixes an issue where reasoning content from models accessed via LiteLLM was not being correctly parsed into theChatCompletionMessage format. This was particularly noticeable when using reasoning models.

2. Context

I am using theopenai-agents-python library in my project, and it has been incredibly helpful. Thank you for building such a great tool!

My setup useslitellm to interface withgemini-2.5-pro. I noticed that while the agent could receive a response, the reasoning(thinking) from the Gemini model was lost during the conversion process from the LiteLLM response format to the OpenAIChatCompletionMessage object.

I saw that PR#871 made progress on a similar issue, but it seems the specific response structure from LiteLLM still requires a small adaptation. This fix adds the necessary logic to ensure that these responses are handled.

Relates to:#871

3. Key Changes

  • LitellmConverter.convert_message_to_openai: addreasoing_content
  • Converter.items_to_messages: just pass the reasoning item

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@zkllll2002@seratch

[8]ページ先頭

©2009-2025 Movatter.jp