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

Add assertion for aiextract #257

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

### Fixed
- Added assertion in `response_to_message` for missing `:tool_calls` key in the response message. It's model failure but it wasn't obvious from the original error.

## [0.69.0]

Expand Down
1 change: 1 addition & 0 deletions src/llm_openai.jl
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@ function response_to_message(schema::AbstractOpenAISchema,
[parse_tool(
tool.callable, content_obj)]
else
@assert haskey(choice[:message], :tool_calls) "`:tool_calls` key is missing in the response message! Retry the request."
## If name does not match, we use the callable from the tool_map
## Can happen only in testing with auto-generated struct
[parse_tool(
Expand Down
Loading