DeepSeek
DeepSeekV3
DeepSeekV3(model_name: str, skill_sources: str | None = None, system_extension: str | None = None, system_template: str = SYSTEM_TEMPLATE, execution_output_template: str = EXECUTION_OUTPUT_TEMPLATE, execution_error_template: str = EXECUTION_ERROR_TEMPLATE, api_key: str | None = None, **kwargs)
Bases: LiteLLM
Code action model class for DeepSeek V3.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_name
|
str
|
The LiteLLM-specific name of the model. |
required |
skill_sources
|
str | None
|
Skill modules source code to be included into |
None
|
system_extension
|
str | None
|
Domain- or environment-specific extensions to the |
None
|
system_template
|
str
|
Prompt template for the system instruction that guides the model to generate code actions.
Must define a |
SYSTEM_TEMPLATE
|
execution_output_template
|
str
|
A template for formatting successful code execution output.
Must define an |
EXECUTION_OUTPUT_TEMPLATE
|
execution_error_template
|
str
|
A template for formatting code execution errors.
Must define an |
EXECUTION_ERROR_TEMPLATE
|
api_key
|
str | None
|
Provider-specific API key. If not provided, reads from |
None
|
**kwargs
|
Default completion kwargs. |
{}
|
Source code in freeact/model/deepseek/model.py
DeepSeekR1
DeepSeekR1(model_name: str, skill_sources: str | None = None, instruction_extension: str | None = EXAMPLE_EXTENSION, instruction_template: str = INSTRUCTION_TEMPLATE, execution_output_template: str = EXECUTION_OUTPUT_TEMPLATE, execution_error_template: str = EXECUTION_ERROR_TEMPLATE, api_key: str | None = None, **kwargs)
Bases: LiteLLM
Code action model class for DeepSeek R1.
Does not set a system instruction. All instructions go into the first user message
formatted with instruction_template
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_name
|
str
|
The LiteLLM-specific name of the model. |
required |
skill_sources
|
str | None
|
Skill modules source code to be included into |
None
|
instruction_extension
|
str | None
|
Domain- or environment-specific extensions to the |
EXAMPLE_EXTENSION
|
instruction_template
|
str
|
Prompt template that guides the model to generate code actions.
Must define a |
INSTRUCTION_TEMPLATE
|
execution_output_template
|
str
|
A template for formatting successful code execution output.
Must define an |
EXECUTION_OUTPUT_TEMPLATE
|
execution_error_template
|
str
|
A template for formatting code execution errors.
Must define an |
EXECUTION_ERROR_TEMPLATE
|
api_key
|
str | None
|
Provider-specific API key. If not provided, reads from |
None
|
**kwargs
|
Default completion kwargs. |
{}
|
Source code in freeact/model/deepseek/model.py
extract_code
extract_code(response: LiteLLMResponse) -> str | None
Extracts the last code block from response.text
.
DeepSeek-R1 often produces code blocks during thinking but usually only the last code block in the actual response is relevant.