Skip to content

Commit

Permalink
Add assertion for aiextract (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
svilupp authored Dec 12, 2024
1 parent c7412d6 commit 7bc7fbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
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

0 comments on commit 7bc7fbd

Please sign in to comment.