Skip to content

Conversation

@twocentstudios
Copy link
Contributor

This PR updates OpenAILanguageModel to include the LanguageModelSession.instructions parameter in requests when provided.

  • For the Responses API, instructions is appended to the body as instructions (docs).
  • For the Chat Completions API, instructions is appended to the messages array with the system tag. (Note: the docs say that developer is preferred over system, but it's presumably backwards compatible).

If disregarding instructions was the intended behavior, feel free to close this PR.

@mattt
Copy link
Owner

mattt commented Nov 5, 2025

Thanks, @twocentstudios! This was indeed an oversight. I appreciate your contributing this fix.

@mattt mattt merged commit c4ace62 into mattt:main Nov 5, 2025
3 checks passed
@mattt
Copy link
Owner

mattt commented Nov 5, 2025

Thanks again for your help, @twocentstudios. This is now available in 0.3.2.

@twocentstudios
Copy link
Contributor Author

Thanks! For the quick version release and for this library and for Sosumi 🙏

@twocentstudios twocentstudios deleted the fix-openai-instruction branch November 6, 2025 07:45
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