Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Semantic Router
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
aurelio-labs
Semantic Router
Commits
9b6eeeea
Unverified
Commit
9b6eeeea
authored
8 months ago
by
James Briggs
Browse files
Options
Downloads
Patches
Plain Diff
fix: change types for 3.9
parent
9bb9921d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
semantic_router/utils/function_call.py
+3
-3
3 additions, 3 deletions
semantic_router/utils/function_call.py
with
3 additions
and
3 deletions
semantic_router/utils/function_call.py
+
3
−
3
View file @
9b6eeeea
import
inspect
import
inspect
from
typing
import
Any
,
Callable
,
Dict
,
List
,
Union
from
typing
import
Any
,
Callable
,
Dict
,
List
,
Optional
,
Union
from
pydantic.v1
import
BaseModel
from
pydantic.v1
import
BaseModel
...
@@ -14,7 +14,7 @@ class Parameter(BaseModel):
...
@@ -14,7 +14,7 @@ class Parameter(BaseModel):
arbitrary_types_allowed
=
True
arbitrary_types_allowed
=
True
name
:
str
=
Field
(
description
=
"
The name of the parameter
"
)
name
:
str
=
Field
(
description
=
"
The name of the parameter
"
)
description
:
str
|
None
=
Field
(
description
:
Optional
[
str
]
=
Field
(
default
=
None
,
description
=
"
The description of the parameter
"
default
=
None
,
description
=
"
The description of the parameter
"
)
)
type
:
str
=
Field
(
description
=
"
The type of the parameter
"
)
type
:
str
=
Field
(
description
=
"
The type of the parameter
"
)
...
@@ -41,7 +41,7 @@ class FunctionSchema:
...
@@ -41,7 +41,7 @@ class FunctionSchema:
output
:
str
=
Field
(
description
=
"
The output of the function
"
)
output
:
str
=
Field
(
description
=
"
The output of the function
"
)
parameters
:
List
[
Parameter
]
=
Field
(
description
=
"
The parameters of the function
"
)
parameters
:
List
[
Parameter
]
=
Field
(
description
=
"
The parameters of the function
"
)
def
__init__
(
self
,
function
:
Callable
|
BaseModel
):
def
__init__
(
self
,
function
:
Union
[
Callable
,
BaseModel
]
):
self
.
function
=
function
self
.
function
=
function
if
callable
(
function
):
if
callable
(
function
):
self
.
_process_function
(
function
)
self
.
_process_function
(
function
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment