-
Notifications
You must be signed in to change notification settings - Fork 167
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
feat: Multiple functions in openai dynamic routes #265
Merged
jamescalam
merged 59 commits into
main
from
multiple_functions_in_openai_dynamic_routes
May 13, 2024
Merged
feat: Multiple functions in openai dynamic routes #265
jamescalam
merged 59 commits into
main
from
multiple_functions_in_openai_dynamic_routes
May 13, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Also showcasing that other (non-dynamic) routes, and choosing no route work as expected.
It was previously (incorrectly) stating that the dynamic route generates functions.
…lt one for OpenAI LLM Routes.
…f treating dynamic routes anymore.
We don't have OpenAI Function Calling Dynamic Routes as an alternative to regular dynamic routes any more, it is now the default.
we don't use openai_function_schema anymore.
PR Description updated to latest commit (a9af91a) |
Siraj-Aizlewood
commented
May 3, 2024
If a single function schema is provided for a Route, then we use OpenAIs inbuilt function calling to determine arguments from the utterance. if more than one function schema is provided then we use our custom prompt.
This reverts commit 47a0fa3.
Also testing and minor bug fixing in Notebook 04 regarding Conversation object and calling the splitter.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #265 +/- ##
==========================================
+ Coverage 80.31% 80.90% +0.59%
==========================================
Files 44 44
Lines 2443 2582 +139
==========================================
+ Hits 1962 2089 +127
- Misses 481 493 +12 ☔ View full report in Codecov by Sentry. |
…/github.com/aurelio-labs/semantic-router into multiple_functions_in_openai_dynamic_routes
jamescalam
reviewed
May 10, 2024
jamescalam
approved these changes
May 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type
enhancement, bug_fix
Description
Changes walkthrough
6 files
layer.py
Update Layer Call Logic to Handle Multiple Function Schemas
semantic_router/layer.py
function_schemas
instead offunction_schema
.base.py
Refactor Base LLM for Multiple Function Schemas Support
semantic_router/llms/base.py
signatures.
openai.py
Enhance OpenAI LLM to Support Multiple Function Schemas
semantic_router/llms/openai.py
responses.
schemas.
route.py
Update Route Handling to Support Multiple Function Schemas
semantic_router/route.py
function_schema
tofunction_schemas
to support multipleschemas.
schemas.
schema.py
Update RouteChoice Model for Multiple Function Calls
semantic_router/schema.py
RouteChoice
model to potentially handle multiple functioncalls.
function_call.py
Refactor Function Call Utilities for Multiple Schemas
semantic_router/utils/function_call.py
1 files
test_llm_openai.py
Extend Tests for OpenAI LLM with Multiple Function Schemas
tests/unit/llms/test_llm_openai.py
4 files
02-dynamic-routes.ipynb
Update Documentation for Dynamic Routes with Multiple Function Schemas
docs/02-dynamic-routes.ipynb
schemas in dynamic routes.
05-local-execution.ipynb
Documentation Update for Local Execution with Multiple Schemas
docs/05-local-execution.ipynb
function_calling.ipynb
Update Example Notebook for Function Calling
docs/examples/function_calling.ipynb
used.
ollama-local-execution.ipynb
Update Ollama Local Execution Example for Multiple Schemas
docs/examples/ollama-local-execution.ipynb