You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,10 +32,10 @@ Arguments:
32
32
*`model` (`str`): The model name to use for token calculation, like gpt-3.5-turbo.
33
33
*`system_prompt` (`str`): The initial system prompt message.
34
34
*`tools` (`List[openai.types.chat.ChatCompletionToolParam]`): (Optional) The tools that will be used in the conversation. These won't be part of the final returned messages, but they will be used to calculate the token count.
35
-
*`tool_choice` (`str | dict`): (Optional) The tool choice that will be used in the conversation. This won't be part of the final returned messages, but it will be used to calculate the token count.
35
+
*`tool_choice` (`openai.types.chat.ChatCompletionNamedToolChoiceParam`): (Optional) The tool choice that will be used in the conversation. This won't be part of the final returned messages, but it will be used to calculate the token count.
36
36
*`new_user_content` (`str | List[openai.types.chat.ChatCompletionContentPartParam]`): (Optional) The content of new user message to append.
37
-
*`past_messages` (`list[dict]`): (Optional) The list of past messages in the conversation.
38
-
*`few_shots` (`list[dict]`): (Optional) A few-shot list of messages to insert after the system prompt.
37
+
*`past_messages` (`list[openai.types.chat.ChatCompletionMessageParam]`): (Optional) The list of past messages in the conversation.
38
+
*`few_shots` (`list[openai.types.chat.ChatCompletionMessageParam]`): (Optional) A few-shot list of messages to insert after the system prompt.
39
39
*`max_tokens` (`int`): (Optional) The maximum number of tokens allowed for the conversation.
40
40
*`fallback_to_default` (`bool`): (Optional) Whether to fallback to default model/token limits if model is not found. Defaults to `False`.
41
41
@@ -83,7 +83,7 @@ Counts the number of tokens in a message.
83
83
Arguments:
84
84
85
85
*`model` (`str`): The model name to use for token calculation, like gpt-3.5-turbo.
86
-
*`message` (`dict`): The message to count tokens for.
86
+
*`message` (`openai.types.chat.ChatCompletionMessageParam`): The message to count tokens for.
87
87
*`default_to_cl100k` (`bool`): Whether to default to the CL100k token limit if the model is not found.
0 commit comments