File tree Expand file tree Collapse file tree 4 files changed +6
-0
lines changed
Expand file tree Collapse file tree 4 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ def create_message(
6464 system : str | list [BetaTextBlockParam ] | Omit = omit ,
6565 thinking : BetaThinkingConfigParam | Omit = omit ,
6666 tool_choice : BetaToolChoiceParam | Omit = omit ,
67+ temperature : float | Omit = omit ,
6768 ) -> MessageParam :
6869 _messages = [
6970 cast ("BetaMessageParam" , message .model_dump (exclude = {"stop_reason" }))
@@ -78,6 +79,7 @@ def create_message(
7879 system = system ,
7980 thinking = thinking ,
8081 tool_choice = tool_choice ,
82+ temperature = temperature ,
8183 timeout = 300.0 ,
8284 )
8385 return MessageParam .model_validate (response .model_dump ())
Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ def _step(
8686 system = settings .messages .system ,
8787 thinking = settings .messages .thinking ,
8888 tool_choice = settings .messages .tool_choice ,
89+ temperature = settings .messages .temperature ,
8990 )
9091 message_by_assistant = self ._call_on_message (
9192 on_message , response_message , truncation_strategy .messages
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ def create_message(
2626 system : str | list [BetaTextBlockParam ] | Omit = omit ,
2727 thinking : BetaThinkingConfigParam | Omit = omit ,
2828 tool_choice : BetaToolChoiceParam | Omit = omit ,
29+ temperature : float | Omit = omit ,
2930 ) -> MessageParam :
3031 """Create a message using the Anthropic API.
3132
@@ -38,6 +39,7 @@ def create_message(
3839 system (str | list[BetaTextBlockParam] | Omit): The system to use.
3940 thinking (BetaThinkingConfigParam | Omit): The thinking to use.
4041 tool_choice (BetaToolChoiceParam | Omit): The tool choice to use.
42+ temperature (float | Omit): The temperature to use.
4143
4244 Returns:
4345 MessageParam: The created message.
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ class MessageSettings(BaseModel):
1818 system : str | list [BetaTextBlockParam ] | Omit = omit
1919 thinking : BetaThinkingConfigParam | Omit = omit
2020 tool_choice : BetaToolChoiceParam | Omit = omit
21+ temperature : float | Omit = Field (default = omit , ge = 0.0 , le = 1.0 )
2122
2223
2324class ActSettings (BaseModel ):
You can’t perform that action at this time.
0 commit comments