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

[BUG] OepnAI JSON format #1048

Closed
tinyrolls opened this issue Oct 30, 2024 · 1 comment · Fixed by #1053
Closed

[BUG] OepnAI JSON format #1048

tinyrolls opened this issue Oct 30, 2024 · 1 comment · Fixed by #1053
Labels
bug Something isn't working

Comments

@tinyrolls
Copy link

tinyrolls commented Oct 30, 2024

Describe the bug
The JSON response format's input structure for OpenAI's API appears to have changed to { "type": "json_object" }, causing compatibility issues with existing implementations.

To Reproduce
Code to reproduce

pipeline.run(
    parameters={
        "task_with_openai": {
            "llm": {
                "generation_kwargs": {
                    "response_format": "json"
                }
            }
        }
    }
)

Expected behaviour
openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid type for 'response_format': expected an object, but got a string instead.", 'type': 'invalid_request_error', 'param': 'response_format', 'code': 'invalid_type'}}

**Additional context
it should be kwargs["response_format"] = {"type": response_format}

kwargs["response_format"] = response_format

@tinyrolls tinyrolls changed the title [BUG] [BUG] OepnAI JSON response format' Nov 1, 2024
@tinyrolls tinyrolls changed the title [BUG] OepnAI JSON response format' [BUG] OepnAI JSON format Nov 1, 2024
@plaguss plaguss linked a pull request Nov 7, 2024 that will close this issue
@plaguss
Copy link
Contributor

plaguss commented Nov 7, 2024

Hi @tinyrolls, thanks for noticing, this PR should fix it: #1053

@plaguss plaguss added the bug Something isn't working label Nov 7, 2024
@plaguss plaguss closed this as completed Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants