Skip to content
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

Function callingを利用可能な状態にする #91

Closed
1 task
keitakn opened this issue Jan 23, 2024 · 0 comments
Closed
1 task

Function callingを利用可能な状態にする #91

keitakn opened this issue Jan 23, 2024 · 0 comments
Assignees

Comments

@keitakn
Copy link
Member

keitakn commented Jan 23, 2024

完了の定義

  • Function calling を利用可能な構成になっている事

補足情報

一旦、天気を返す関数を返す実装して試してみる。

@keitakn keitakn self-assigned this Jan 23, 2024
keitakn added a commit that referenced this issue Jan 26, 2024
keitakn added a commit that referenced this issue Jan 26, 2024
keitakn added a commit that referenced this issue Jan 27, 2024
src/infrastructure/repository/openai/openai_cat_message_repository.py:82: error: Argument 1 to "loads" has incompatible type "str | None"; expected "str | bytes | bytearray"  [arg-type]
keitakn added a commit that referenced this issue Jan 27, 2024
src/infrastructure/repository/openai/openai_cat_message_repository.py:92: error: Argument 1 to "append" of "list" has incompatible type "dict[str, str]"; expected "ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam"  [arg-type]
keitakn added a commit that referenced this issue Jan 27, 2024
src/infrastructure/repository/openai/openai_cat_message_repository.py:142: error: Function is missing a return type annotation  [no-untyped-def]
keitakn added a commit that referenced this issue Jan 27, 2024
src/infrastructure/repository/openai/openai_cat_message_repository.py:56: error: No overload variant of "create" of "AsyncCompletions" matches argument types "str", "list[ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam]", "bool", "float", "str", "list[dict[str, Collection[str]]]", "str"  [call-overload]
src/infrastructure/repository/openai/openai_cat_message_repository.py:56: note: Possible overload variants:
src/infrastructure/repository/openai/openai_cat_message_repository.py:56: note:     def create(self, *, messages: list[ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: Literal['gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-16k-0613'] | str, frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: list[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., n: int | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., response_format: ResponseFormat | NotGiven = ..., seed: int | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., stream: Literal[False] | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: list[ChatCompletionToolParam] | NotGiven = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion]
src/infrastructure/repository/openai/openai_cat_message_repository.py:56: note:     def create(self, *, messages: list[ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: Literal['gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-16k-0613'] | str, stream: Literal[True], frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: list[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., n: int | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., response_format: ResponseFormat | NotGiven = ..., seed: int | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: list[ChatCompletionToolParam] | NotGiven = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, AsyncStream[ChatCompletionChunk]]
src/infrastructure/repository/openai/openai_cat_message_repository.py:56: note:     def create(self, *, messages: list[ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam], model: Literal['gpt-4-1106-preview', 'gpt-4-vision-preview', 'gpt-4', 'gpt-4-0314', 'gpt-4-0613', 'gpt-4-32k', 'gpt-4-32k-0314', 'gpt-4-32k-0613', 'gpt-3.5-turbo-1106', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-0301', 'gpt-3.5-turbo-0613', 'gpt-3.5-turbo-16k-0613'] | str, stream: bool, frequency_penalty: float | NotGiven | None = ..., function_call: Literal['none', 'auto'] | ChatCompletionFunctionCallOptionParam | NotGiven = ..., functions: list[Function] | NotGiven = ..., logit_bias: dict[str, int] | NotGiven | None = ..., max_tokens: int | NotGiven | None = ..., n: int | NotGiven | None = ..., presence_penalty: float | NotGiven | None = ..., response_format: ResponseFormat | NotGiven = ..., seed: int | NotGiven | None = ..., stop: str | list[str] | NotGiven | None = ..., temperature: float | NotGiven | None = ..., tool_choice: Literal['none', 'auto'] | ChatCompletionNamedToolChoiceParam | NotGiven = ..., tools: list[ChatCompletionToolParam] | NotGiven = ..., top_p: float | NotGiven | None = ..., user: str | NotGiven = ..., extra_headers: Mapping[str, str | Omit] | None = ..., extra_query: Mapping[str, object] | None = ..., extra_body: object | None = ..., timeout: float | Timeout | NotGiven | None = ...) -> Coroutine[Any, Any, ChatCompletion | AsyncStream[ChatCompletionChunk]]
Found 1 error in 1 file (checked 33 source files)
keitakn added a commit that referenced this issue Jan 27, 2024
src/infrastructure/repository/openai/openai_cat_message_repository.py:85: error: Unsupported left operand type for + ("None")  [operator]
src/infrastructure/repository/openai/openai_cat_message_repository.py:85: note: Left operand is of type "str | None"
Found 1 error in 1 file (checked 33 source files)
keitakn added a commit that referenced this issue Jan 31, 2024
src/infrastructure/repository/openai/openai_cat_message_repository.py:104: error: Item "None" of "list[ChatCompletionMessageToolCall] | None" has no attribute "__iter__" (not iterable)  [union-attr]
src/infrastructure/repository/openai/openai_cat_message_repository.py:123: error: Incompatible return value type (got "list[dict[str, str | Any] | ChatCompletionMessage | ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam]", expected "list[ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam | ChatCompletionToolMessageParam | ChatCompletionFunctionMessageParam]")  [return-value]
src/infrastructure/repository/openai/openai_cat_message_repository.py:128: error: Function is missing a return type annotation  [no-untyped-def]
Found 3 errors in 1 file (checked 33 source files)
@keitakn keitakn closed this as completed Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant