-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify OpenAI VectorSearchRetrieverTool tool execution function #44
Simplify OpenAI VectorSearchRetrieverTool tool execution function #44
Conversation
# OpenAI tool names must match the pattern '^[a-zA-Z0-9_-]+$'." | ||
# The '.' from the index name are not allowed | ||
def rewrite_index_name(index_name: str): | ||
return index_name.replace(".", "_") | ||
def get_tool_name(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# OpenAI tool names must match the pattern '^[a-zA-Z0-9_-]+$'." | ||
# The '.' from the index name are not allowed | ||
def rewrite_index_name(index_name: str): | ||
return index_name.replace(".", "_") | ||
def get_tool_name(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to make this into a public API so that we can just officially recommend customers use it to get the name of the vector search tool, but ok to do that in a follow-up
integrations/openai/src/databricks_openai/vector_search_retriever_tool.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…ver_tool.py Co-authored-by: Siddharth Murching <[email protected]>
This PR refactors the OpenAI VectorSearchRetrieverTool#execute_tools function to be VectorSearchRetrieverTool#execute. The goal here is to do less of the response parsing and instead only focus on executing the retriever call, which is more in line with how the OpenAI SDK documents function calling.
The new usage pattern is more along the lines of: