mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-28 19:05:31 +02:00
Add temperature to swarm
This commit is contained in:
parent
546c7f2f6d
commit
affb6c18ca
2 changed files with 6 additions and 2 deletions
|
|
@ -39,6 +39,7 @@ class Swarm:
|
||||||
model_override: str,
|
model_override: str,
|
||||||
stream: bool,
|
stream: bool,
|
||||||
debug: bool,
|
debug: bool,
|
||||||
|
temperature: float
|
||||||
) -> ChatCompletionMessage:
|
) -> ChatCompletionMessage:
|
||||||
context_variables = defaultdict(str, context_variables)
|
context_variables = defaultdict(str, context_variables)
|
||||||
instructions = (
|
instructions = (
|
||||||
|
|
@ -65,6 +66,7 @@ class Swarm:
|
||||||
"tools": funcs_and_tools or None,
|
"tools": funcs_and_tools or None,
|
||||||
"tool_choice": agent.tool_choice,
|
"tool_choice": agent.tool_choice,
|
||||||
"stream": stream,
|
"stream": stream,
|
||||||
|
"temperature": temperature
|
||||||
}
|
}
|
||||||
|
|
||||||
if funcs_and_tools:
|
if funcs_and_tools:
|
||||||
|
|
@ -155,7 +157,8 @@ class Swarm:
|
||||||
external_tools: List[str] = [],
|
external_tools: List[str] = [],
|
||||||
localize_history: bool = True,
|
localize_history: bool = True,
|
||||||
parent_has_child_history: bool = True,
|
parent_has_child_history: bool = True,
|
||||||
tokens_used: dict = {}
|
tokens_used: dict = {},
|
||||||
|
temperature: float = 0.0
|
||||||
) -> Response:
|
) -> Response:
|
||||||
|
|
||||||
active_agent = agent
|
active_agent = agent
|
||||||
|
|
@ -180,7 +183,8 @@ class Swarm:
|
||||||
context_variables=context_variables,
|
context_variables=context_variables,
|
||||||
model_override=model_override,
|
model_override=model_override,
|
||||||
stream=stream,
|
stream=stream,
|
||||||
debug=debug
|
debug=debug,
|
||||||
|
temperature=temperature
|
||||||
)
|
)
|
||||||
tokens_used = update_tokens_used(provider="openai", model=model_override or active_agent.model, tokens_used=tokens_used, completion=completion)
|
tokens_used = update_tokens_used(provider="openai", model=model_override or active_agent.model, tokens_used=tokens_used, completion=completion)
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 35 KiB |
Loading…
Add table
Add a link
Reference in a new issue