Skip to content

How to return a vector []float32 from a tool call #324

Answered by jba
Dabnis asked this question in Q&A
Discussion options

You must be logged in to vote

I would use the StructuredContent field to return it as JSON.
In our current API, your tool handler would look like:

func(context.Context, *ServerRequest[*CallToolParamsFor[In]]) (*CallToolResultFor[[]float64], error)

where In is whatever the input to your function is.

But note, this API will be changing in v0.3.0, due out Friday.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Dabnis
Comment options

Answer selected by Dabnis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants