add openrouter reasoning

This commit is contained in:
better629 2025-02-27 18:24:43 +08:00
parent 9245e8ab80
commit ff477066c5
9 changed files with 115 additions and 17 deletions

View file

@ -36,6 +36,7 @@ class LLMType(Enum):
MISTRAL = "mistral"
YI = "yi" # lingyiwanwu
OPENROUTER = "openrouter"
OPENROUTER_REASONING = "openrouter_reasoning"
BEDROCK = "bedrock"
ARK = "ark" # https://www.volcengine.com/docs/82379/1263482#python-sdk
@ -102,7 +103,7 @@ class LLMConfig(YamlModel):
# reasoning / thinking switch
reasoning: bool = False
reasoning_tokens: int = 4000 # reasoning budget tokens to generate, usually smaller than max_tokens
reasoning_max_token: int = 1024 # reasoning budget tokens to generate, usually smaller than max_token
@field_validator("api_key")
@classmethod