Change tool_calls
to be an Option in response (#13778)
Here is an image of my now getting assistance responses!  I ended up adding a function to handle the use case of not serializing the tool_calls response if it is either null or empty to keep the functionality of the existing implementation (not deserializing if vec is empty). I'm sorta a noob, so happy to make changes if this isn't done correctly, although it does work and it does pass tests! Thanks a bunch to [amtoaer](https://github.com/amtoaer) for pointing me in the direction on how to fix it. Release Notes: - Fixed some responses being dropped from OpenAI-compatible providers ([#13741](https://github.com/zed-industries/zed/issues/13741)).
This commit is contained in:
parent
64755a7aea
commit
995b082c64
2 changed files with 7 additions and 2 deletions
|
@ -4462,6 +4462,7 @@ async fn complete_with_open_ai(
|
|||
tool_calls: choice
|
||||
.delta
|
||||
.tool_calls
|
||||
.unwrap_or_default()
|
||||
.into_iter()
|
||||
.map(|delta| proto::ToolCallDelta {
|
||||
index: delta.index as u32,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue