Skip to content

Commit

Permalink
Merge pull request #132 from rgbkrk/fix-tool-type
Browse files Browse the repository at this point in the history
fix the type on FunctionRegistry.tools
  • Loading branch information
rgbkrk committed Feb 27, 2024
2 parents 2b0e0cc + c4c3138 commit f700287
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chatlab/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ class WhatTime(BaseModel):
from openai.types.chat.completion_create_params import Function, FunctionCall
from pydantic import BaseModel, create_model

from openai.types.chat import ChatCompletionToolParam

from .decorators import ChatlabMetadata


Expand Down Expand Up @@ -429,7 +431,7 @@ def api_manifest(self, function_call_option: FunctionCall = "auto") -> APIManife
}

@property
def tools(self):
def tools(self) -> Iterable[ChatCompletionToolParam]:
return [{"type": "function", "function": adapt_function_definition(f)} for f in self.__schemas.values()]

async def call(self, name: str, arguments: Optional[str] = None) -> Any:
Expand Down

0 comments on commit f700287

Please sign in to comment.