Skip to content

Commit

Permalink
Provided a readable way to have no tool_choice
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbraza committed Dec 4, 2024
1 parent 6b2b487 commit bd2a710
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ldp/llms/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ async def achat_iter(self, messages: Iterable[Message], **kwargs) -> AsyncGenera
# SEE: https://platform.openai.com/docs/api-reference/chat/create#chat-create-tool_choice
# > `required` means the model must call one or more tools.
TOOL_CHOICE_REQUIRED: ClassVar[str] = "required"
# None means we won't provide a tool_choice
NO_TOOL_CHOICE: ClassVar[None] = None

async def call( # noqa: C901, PLR0915
self,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ async def memory_factory(
content=LessonEntry.make_prompt(query_airesponse_dreturns)
)
],
tool_choice="none",
tool_choice=memory_distiller.NO_TOOL_CHOICE,
output_type=LessonEntry,
)
if (
Expand Down

0 comments on commit bd2a710

Please sign in to comment.