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

Updates the tool call struct #595

Merged

Conversation

albertpurnama
Copy link
Contributor

@albertpurnama albertpurnama commented Nov 18, 2023

A similar PR may already be submitted!
Please search among the Pull request before creating one.

If your changes introduce breaking changes, please prefix the title of your pull request with "[BREAKING_CHANGES]". This allows for clear identification of such changes in the 'What's Changed' section on the release page, making it developer-friendly.

Thanks for submitting a pull request! Please provide enough information so that others can review your pull request.

Describe the change

Querying run steps will create marshalling error like:
json: cannot unmarshal array into Go struct field StepDetails.data.step_details.tool_calls of type openai.StepDetailsToolCalls

Screenshot 2023-11-17 at 8 25 16 PM

The official docs of the run steps points to using arrays instead of wrapping tool_calls in an object.

Here's the actual response of fetching run step:

Screenshot 2023-11-17 at 8 25 16 PM

Describe your solution
This PR addresses this by removing the extra wrapping object around tool_calls property.

Tests
N/A

Additional context

Issue: No issues created yet, should I create one? 🤔

Copy link

codecov bot commented Nov 18, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1846572) 98.38% compared to head (02d014e) 98.38%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #595   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files          24       24           
  Lines        1300     1300           
=======================================
  Hits         1279     1279           
  Misses         15       15           
  Partials        6        6           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@sashabaranov sashabaranov left a comment

Choose a reason for hiding this comment

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

Thank you for the PR!

@sashabaranov sashabaranov merged commit 9efad28 into sashabaranov:master Nov 18, 2023
maerlyn5 pushed a commit to prassoai/go-openai that referenced this pull request Nov 22, 2023
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