-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
python_tests() | ||
python_tests( | ||
interpreter_constraints=["==3.10.*"] | ||
) |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
"""Utils for OpenAI agent.""" | ||
|
||
from typing import Union | ||
from llama_index.llms.openai.utils import resolve_tool_choice | ||
|
||
|
||
def resolve_tool_choice(tool_choice: Union[str, dict] = "auto") -> Union[str, dict]: | ||
"""Resolve tool choice. | ||
If tool_choice is a function name string, return the appropriate dict. | ||
""" | ||
if isinstance(tool_choice, str) and tool_choice not in ["none", "auto", "required"]: | ||
return {"type": "function", "function": {"name": tool_choice}} | ||
|
||
return tool_choice | ||
__all__ = ["resolve_tool_choice"] |