From bec4bc0e8386a9866904ab92cc55df1d155549df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=A3=92=E6=A3=92?= Date: Tue, 21 Nov 2023 17:01:03 +0800 Subject: [PATCH] chore: add comments for `kwargs`. --- metagpt/provider/openai_api.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/metagpt/provider/openai_api.py b/metagpt/provider/openai_api.py index ef9b790ce..af7810b62 100644 --- a/metagpt/provider/openai_api.py +++ b/metagpt/provider/openai_api.py @@ -243,6 +243,9 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter): return self.get_choice_text(rsp) def _func_configs(self, messages: list[dict], **kwargs) -> dict: + """ + Note: Keep kwargs consistent with the parameters in the https://platform.openai.com/docs/api-reference/chat/create + """ if "tools" not in kwargs: configs = { "tools": [{"type": "function", "function": general_function_schema}], @@ -280,7 +283,8 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter): def ask_code(self, messages: Union[str, Message, list[dict]], **kwargs) -> dict: """Use function of tools to ask a code. - https://platform.openai.com/docs/api-reference/chat/create#chat-create-tools + + Note: Keep kwargs consistent with the parameters in the https://platform.openai.com/docs/api-reference/chat/create Examples: @@ -297,7 +301,8 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter): async def aask_code(self, messages: Union[str, Message, list[dict]], **kwargs) -> dict: """Use function of tools to ask a code. - https://platform.openai.com/docs/api-reference/chat/create#chat-create-tools + + Note: Keep kwargs consistent with the parameters in the https://platform.openai.com/docs/api-reference/chat/create Examples: