mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
feat: Support seed parameter (#7441)
This commit is contained in:
parent
e639283ac9
commit
2518901e6e
@ -48,6 +48,7 @@ docker pull docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik
|
||||
docker run -it --rm --pull=always \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.all-hands.dev/all-hands-ai/runtime:0.29-nikolaik \
|
||||
-e LOG_ALL_EVENTS=true \
|
||||
-e LLM_SEED=42 \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v ~/.openhands-state:/.openhands-state \
|
||||
-p 3000:3000 \
|
||||
|
||||
@ -43,6 +43,7 @@ class LLMConfig(BaseModel):
|
||||
custom_tokenizer: A custom tokenizer to use for token counting.
|
||||
native_tool_calling: Whether to use native tool calling if supported by the model. Can be True, False, or not set.
|
||||
reasoning_effort: The effort to put into reasoning. This is a string that can be one of 'low', 'medium', 'high', or 'none'. Exclusive for o1 models.
|
||||
seed: The seed to use for the LLM.
|
||||
"""
|
||||
|
||||
model: str = Field(default='claude-3-7-sonnet-20250219')
|
||||
@ -82,6 +83,7 @@ class LLMConfig(BaseModel):
|
||||
custom_tokenizer: str | None = Field(default=None)
|
||||
native_tool_calling: bool | None = Field(default=None)
|
||||
reasoning_effort: str | None = Field(default='high')
|
||||
seed: int | None = Field(default=None)
|
||||
|
||||
model_config = {'extra': 'forbid'}
|
||||
|
||||
|
||||
@ -34,6 +34,7 @@ class AsyncLLM(LLM):
|
||||
temperature=self.config.temperature,
|
||||
top_p=self.config.top_p,
|
||||
drop_params=self.config.drop_params,
|
||||
seed=self.config.seed,
|
||||
)
|
||||
|
||||
async_completion_unwrapped = self._async_completion
|
||||
|
||||
@ -165,6 +165,7 @@ class LLM(RetryMixin, DebugMixin):
|
||||
timeout=self.config.timeout,
|
||||
top_p=self.config.top_p,
|
||||
drop_params=self.config.drop_params,
|
||||
seed=self.config.seed,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user