Skip to content

Revision#30

Merged
rmaze merged 8 commits intomainfrom
revision
Sep 21, 2025
Merged

Revision#30
rmaze merged 8 commits intomainfrom
revision

Conversation

@EggerMarc
Copy link
Copy Markdown
Owner

Changelog

  1. Added FunctionResponse as the response struct of a successful tool call.
    This struct will hold id: Option<CallId>, name: String, result: Value as 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.

  2. Added CallId in both FunctionResponse (as stated above) and FunctionCall.
    Attaching an id to a tool call 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.

  3. Implemented Display for FunctionResponse.

Breaking changes

  1. Call a new function call with new instead of building it out manually. new will assign an id to the FunctionCall. If you do not wish to have an id to the call, manually set it to None, as such
FunctionCall {
  None,
  name: "function_name".to_string(),
  arguments: json!({})
}
  1. Upon successful response, to get the response values themselves, call .result to FunctionResponse.

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.

@EggerMarc EggerMarc linked an issue Sep 17, 2025 that may be closed by this pull request
@EggerMarc EggerMarc requested a review from rmaze September 17, 2025 11:37
@EggerMarc
Copy link
Copy Markdown
Owner Author

Pushed to a previous version of tools-rs, fixed it in the last commits. @rmaze requesting approval.

@EggerMarc EggerMarc linked an issue Sep 17, 2025 that may be closed by this pull request
Signed-off-by: Marc <44448012+EggerMarc@users.noreply.github.com>
Signed-off-by: Marc <44448012+EggerMarc@users.noreply.github.com>
@rmaze rmaze merged commit ba21dbd into main Sep 21, 2025
2 checks passed
@rmaze rmaze deleted the revision branch September 21, 2025 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ids to the FunctionCall and FunctionResponse structs Define FunctionResponse as the resulting type of function calls

2 participants