Anthropic Messages API client (Claude). Plain and multi-turn chat with a system prompt, tool use, streaming over server-sent events, structured (JSON) output through a forced tool, and extended-thinking blocks. Responses and errors follow the other AI client libraries: a failed call returns Nil and EndPoint->GetLastError() says why. The key comes from SetApiKey, the ANTHROPIC_API_KEY environment variable, or anthropic_api_key.dat in the working directory. Requests go over HTTPS. Compile with -lib anthropic.
ToolUse
A tool call the model asked for. Run it, then return the result with Chat->AddToolResult using GetId().
Operations
GetArgument #
Get one input value as text (a number or boolean in its JSON form)
method : public : GetArgument(name:String) ~ StringParameters
| Name | Type | Description |
|---|---|---|
| name | String | parameter name |
Return
| Type | Description |
|---|---|
| String | value text, or Nil if absent |
GetId #
Get the id the result must carry
method : public : GetId() ~ StringReturn
| Type | Description |
|---|---|
| String | tool use id |
GetInput #
Get the call's input, an object keyed by parameter name
method : public : GetInput() ~ JsonElementReturn
| Type | Description |
|---|---|
| JsonElement | input |