cerebras
autogen.oai.cerebras.CerebrasClient
CerebrasClient
Client for Cerebras’s API.
Requires api_key or environment variable to be set
Name | Description |
---|---|
api_key=None | |
**kwargs |
Static Methods
get_usage
Return usage summary of the response using RESPONSE_USAGE_KEYS.
Parameters:Name | Description |
---|---|
response | Type: ChatCompletion |
Instance Methods
cost
Name | Description |
---|---|
response | Type: ChatCompletion |
create
Call self as a function.
Parameters:Name | Description |
---|---|
*args | |
**kwargs |
message_retrieval
Retrieve and return a list of strings or a list of Choice.Message from the response.
NOTE: if a list of Choice.Message is returned, it currently needs to contain the fields of OpenAI’s ChatCompletion Message object,
since that is expected for function or tool calling in the rest of the codebase at the moment, unless a custom agent is being used.
Name | Description |
---|---|
response | Type: ChatCompletion |
parse_params
Loads the parameters for Cerebras API from the passed in parameters and returns a validated set. Checks types, ranges, and sets defaults
Parameters:Name | Description |
---|---|
params | Type: dict[str, Any] |