cequence-io / openai-scala-client

Scala client for OpenAI API
MIT License
191 stars 20 forks source link

Fixes AssistantToolMessage's json reads #78

Closed SunPj closed 2 months ago

SunPj commented 2 months ago

Fixes "Cannot be parsed due to: JSON at path '/choices(0)/message/too……l_calls' contains the following errors: error.path.missing"

Even though OpenAI response schema defines tool_calls as being an array, that field might be absent in response if the output is generated text and not function call

peterbanda commented 2 months ago

@SunPj Thanks for the fix!

peterbanda commented 2 months ago

Seems like you need value.toSeq. See here: https://github.com/cequence-io/openai-scala-client/actions/runs/10451354268/job/29273044914?pr=78

SunPj commented 2 months ago

@peterbanda Will there be any release to start using the library with those changes?