Repository navigation
v0.1.2
Pre-releaseChangelog
-
Added
FunctionResponseas the response struct of a successfultoolcall.
This struct will holdid: Option<CallId>,name: String,result: Valueas fields and implements serde serialization, as display, and PartialEq. The idea behind is to be able to further down the road add tracing to function calls for better management of calls, as well as improved control in serialization. -
Added
CallIdin bothFunctionResponse(as stated above) andFunctionCall.
Attaching an id to atoolcall is a common practice across LLM providers, as we're able to more easily build stack traces and logging. This is a requirement to later on build tracing support. -
Implemented
DisplayforFunctionResponse.
Breaking changes
- Call a new function call with
newinstead of building it out manually.newwill assign an id to theFunctionCall. If you do not wish to have an id to the call, manually set it toNone, as such
FunctionCall {
None,
name: "function_name".to_string(),
arguments: json!({})
}- Upon successful response, to get the response values themselves, call
.resulttoFunctionResponse.
Previously, a tool call would simply result in serde::Value. Now, as stated above, you need to manually take the result field of the FunctionResponse.