Skip to content

Commit

Permalink
fix: Added temperature parameter to RequestBody (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwilsonmg authored Oct 4, 2024
1 parent 1d0ab9f commit 3302ba8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions instructor/batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class RequestBody(BaseModel):
model: Union[openai_models, str]
messages: list[dict[str, Any]]
max_tokens: int = Field(default=1000)
temperature: float = Field(default=1.0)
tools: list[Tool]
tool_choice: dict[str, Any]

Expand Down Expand Up @@ -88,6 +89,7 @@ def create_from_messages(
response_model: type[BaseModel],
file_path: str,
max_tokens: int = 1000,
temperature: float = 1.0,
):
_, kwargs = handle_response_model(response_model=response_model)

Expand All @@ -102,6 +104,7 @@ def create_from_messages(
model=model,
max_tokens=max_tokens,
messages=messages,
temperature=temperature,
**kwargs,
),
).model_dump_json()
Expand Down

0 comments on commit 3302ba8

Please sign in to comment.