experience pool

This commit is contained in:
seehi 2024-06-03 10:14:57 +08:00
parent 5c416a1f31
commit 15b86e8533
10 changed files with 106 additions and 0 deletions

View file

@ -1,4 +1,5 @@
"""class tools, including method inspection, class attributes, inheritance relationships, etc."""
import inspect
def check_methods(C, *methods):
@ -16,3 +17,11 @@ def check_methods(C, *methods):
else:
return NotImplemented
return True
def get_func_full_name(func, *args) -> str:
if inspect.ismethod(func) or (inspect.isfunction(func) and "self" in inspect.signature(func).parameters):
cls_name = args[0].__class__.__name__
return f"{func.__module__}.{cls_name}.{func.__name__}"
return f"{func.__module__}.{func.__name__}"

View file

@ -150,6 +150,8 @@ TOKEN_MAX = {
"gpt-4-1106-preview": 128000,
"gpt-4-vision-preview": 128000,
"gpt-4-1106-vision-preview": 128000,
"gpt-4-turbo": 128000,
"gpt-4o": 128000,
"gpt-4": 8192,
"gpt-4-0613": 8192,
"gpt-4-32k": 32768,