Skip to content
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

feat: Add support for response_format and seed in OpenAI and Azure OpenAI invocation layers #7422

Merged
merged 2 commits into from
Mar 26, 2024

Conversation

sjrl
Copy link
Contributor

@sjrl sjrl commented Mar 26, 2024

Related Issues

Proposed Changes:

Allows users to pass response_format and seed through the model_kwargs of the PromptNode when using OpenAI or Azure OpenAI invocation layers.

Example usage

openai = PromptNode(
    model_name_or_path="gpt-3.5-turbo",
    model_kwargs={"seed": 42, "response_format": {"type": "json_object"}},
    api_key=API_KEY
)
openai.prompt("Create a sample JSON output")
# ['{\n  "name": "John Doe",\n  "age": 30,\n  "city": "New York",\n  "email": "[email protected]",\n  "phone": "555-555-5555"\n}']

How did you test it?

Manually tested it.

Notes for the reviewer

Checklist

@sjrl sjrl requested a review from a team as a code owner March 26, 2024 07:40
@sjrl sjrl requested review from anakin87 and removed request for a team March 26, 2024 07:40
@sjrl sjrl removed the request for review from anakin87 March 26, 2024 09:51
@sjrl sjrl requested a review from shadeMe March 26, 2024 09:53
Copy link
Collaborator

@shadeMe shadeMe left a comment

Choose a reason for hiding this comment

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

LGTM!

@sjrl sjrl merged commit b825b3d into v1.x Mar 26, 2024
49 checks passed
@sjrl sjrl deleted the openai-kwargs branch March 26, 2024 10:20
@vblagoje vblagoje added this to the 1.25.2 milestone Mar 28, 2024
vblagoje pushed a commit that referenced this pull request Apr 2, 2024
…e OpenAI invocation layers (#7422)

* Add support for response_format and seed

* PR comments
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.

3 participants