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

Fix OpenAiInferenceEngine #1193

Merged
merged 6 commits into from
Sep 8, 2024

Conversation

yifanmai
Copy link
Contributor

@yifanmai yifanmai commented Sep 3, 2024

Fixes two issues as follows:

Sets logprobs to True in the request, because it is required since top_logprobs is set to 20. Otherwise, this error occurs:

  File "/path/to/lib/python3.8/site-packages/openai/_base_client.py", line 1046, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': "The 'top_logprobs' parameter is only allowed when 'logprobs' is enabled.", 'type': 'invalid_request_error', 'param': 'top_logprobs', 'code': None}}

Removes request parameters from the OpenAI request if the value is null. Otherwise, this error occurs:

  File "/path/to/lib/python3.8/site-packages/openai/_base_client.py", line 1046, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': "Invalid type for 'parallel_tool_calls': expected a boolean, but got null instead.", 'type': 'invalid_request_error', 'param': 'parallel_tool_calls', 'code': 'invalid_type'}}

Signed-off-by: Yifan Mai <yifan@cs.stanford.edu>
@yifanmai yifanmai force-pushed the yifanmai/fix-openai-inference-engine branch from 3c4af14 to 219bb14 Compare September 3, 2024 03:15
@elronbandel elronbandel enabled auto-merge (squash) September 8, 2024 10:26
@elronbandel elronbandel merged commit 19accb4 into IBM:main Sep 8, 2024
8 checks passed
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