Skip to content

Commit

Permalink
fix: change types for 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescalam committed Aug 14, 2024
1 parent 9bb9921 commit 9b6eeee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions semantic_router/utils/function_call.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import inspect
from typing import Any, Callable, Dict, List, Union
from typing import Any, Callable, Dict, List, Optional, Union

from pydantic.v1 import BaseModel

Expand All @@ -14,7 +14,7 @@ class Config:
arbitrary_types_allowed = True

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"
)
type: str = Field(description="The type of the parameter")
Expand All @@ -41,7 +41,7 @@ class FunctionSchema:
output: str = Field(description="The output 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
if callable(function):
self._process_function(function)
Expand Down

0 comments on commit 9b6eeee

Please sign in to comment.