fix: openai tool tokens (#2026)
This commit is contained in:
parent
d8c0d722d2
commit
149102927b
2 changed files with 26 additions and 2 deletions
|
|
@ -765,7 +765,6 @@ class OpenAILargeLanguageModel(_CommonOpenAI, LargeLanguageModel):
|
|||
num_tokens = 0
|
||||
for tool in tools:
|
||||
num_tokens += len(encoding.encode('type'))
|
||||
num_tokens += len(encoding.encode(tool.get("type")))
|
||||
num_tokens += len(encoding.encode('function'))
|
||||
|
||||
# calculate num tokens for function object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue