Features of Anthropic Models
Last updated
Was this helpful?
Last updated
Was this helpful?
Text completions: Build advanced chat bots or text processors
Function Calling: Utilize tools for specific tasks and API calling.
Vision Tasks: Process and analyze images.
image/png
image/gif
image/webp
To process text and use function calling, follow the examples below:
The responses from the AI/ML API for Anthropic models will typically include the generated text or results from the tool called. Here is an example response for a weather query:
To enable streaming of responses, set stream=True
in your request payload.
The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API.
512
Custom text sequences that will cause the model to stop generating.
If set to True, the model response data will be streamed to the client as it is generated using server-sent events.
false
A system prompt is a way of providing context and instructions to Claude, such as specifying a particular goal or role.
Amount of randomness injected into the response. Defaults to 1.0. Ranges from 0.0 to 1.0. Use temperature closer to 0.0 for analytical / multiple choice, and closer to 1.0 for creative and generative tasks. Note that even with temperature of 0.0, the results will not be fully deterministic.
1
Controls which (if any) tool is called by the model. none means the model will not call any tool and instead generates a message. auto means the model can pick between generating a message or calling one or more tools. required means the model must call one or more tools. Specifying a particular tool via {"type": "function", "function": {"name": "my_function"}} forces the model to call that tool. none is the default when no tools are present. auto is the default if tools are present.
Only sample from the top K options for each subsequent token. Used to remove "long tail" low probability responses. Recommended for advanced use cases only. You usually only need to use temperature.
An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both.
No content