Skip to content

Commit

Permalink
Merge pull request #10 from weavel-ai/fix/temperature
Browse files Browse the repository at this point in the history
fix: fix temperature not apply bug, fix model selection for structure…
  • Loading branch information
engineerA314 authored Sep 1, 2024
2 parents f5e65e7 + 75424ea commit ff1efa9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ape/prompt/prompt_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ async def __call__(
"""
if lm_config is None:
lm_config = {}

if "temperature" not in lm_config:
lm_config["temperature"] = self.temperature

if self.inputs_desc:
inputs = {k: v for k, v in kwargs.items() if k in self.inputs_desc}
if len(inputs) != len(self.inputs_desc):
Expand All @@ -184,7 +188,8 @@ async def __call__(
if self.response_format:
if self.response_format.type != "xml":
if self.response_format.type == "json_schema":
model = "gpt-4o-2024-08-06"
if model not in ["gpt-4o-2024-08-06", "gpt-4o-mini"]:
model = "gpt-4o-2024-08-06"
response_format = self.response_format.model_dump(exclude_none=True)

try:
Expand Down

0 comments on commit ff1efa9

Please sign in to comment.