jamesrochabrun / SwiftAnthropic

An open-source Swift package for interacting with Anthropic's public API.
90 stars 29 forks source link

Question: how to construct input message for type `tool_use` and `tool_result` #10

Closed longseespace closed 5 months ago

longseespace commented 6 months ago

Hi. Thanks for this wonderful library. I'm running into an issue with Function Calling though.

I was able to construct the request with tools specification and get back the response from Anthropic on which tools to use etc.

However, how can I send the following up request with the tool result?

The MessageParameter.Message seems to support only text and image type, while we need tool_use (for assistant message) and tool_result (for user message)

Thanks

longseespace commented 6 months ago

I added a PR for this https://github.com/jamesrochabrun/SwiftAnthropic/pull/11