feat: support pydantic models in tool uploads + patch dict/list types (#2112)

This commit is contained in:
Charles Packer
2024-11-30 10:09:03 -08:00
committed by GitHub
parent 58ec6238a8
commit 6be2000eda
26 changed files with 1173 additions and 53 deletions

View File

@@ -121,7 +121,7 @@ def num_tokens_from_functions(functions: List[dict], model: str = "gpt-4"):
function_tokens += 3
function_tokens += len(encoding.encode(o))
else:
print(f"Warning: not supported field {field}")
warnings.warn(f"num_tokens_from_functions: Unsupported field {field} in function {function}")
function_tokens += 11
num_tokens += function_tokens