langfun 0.0.2.dev20240513__tar.gz → 0.0.2.dev20240516__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/PKG-INFO +1 -1
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/__init__.py +24 -10
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/openai.py +31 -16
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/vertexai.py +5 -5
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/vertexai_test.py +6 -7
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun.egg-info/PKG-INFO +1 -1
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/LICENSE +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/README.md +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/__init__.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/__init__.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/__init__.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/__init__.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/correction.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/correction_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/errors.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/errors_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/execution.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/execution_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/generation.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/generation_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/parsing.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/parsing_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/permissions.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/permissions_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/component.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/component_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/concurrent.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/concurrent_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/console.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/console_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/eval/__init__.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/eval/base.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/eval/base_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/eval/matching.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/eval/matching_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/eval/patching.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/eval/patching_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/eval/scoring.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/eval/scoring_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/langfunc.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/langfunc_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/language_model.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/language_model_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/anthropic.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/anthropic_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/cache/__init__.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/cache/base.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/cache/in_memory.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/cache/in_memory_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/fake.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/fake_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/google_genai.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/google_genai_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/groq.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/groq_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/llama_cpp.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/llama_cpp_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/openai_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/memories/__init__.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/memories/conversation_history.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/memories/conversation_history_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/memory.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/message.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/message_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/modalities/__init__.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/modalities/image.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/modalities/image_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/modalities/mime.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/modalities/mime_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/modalities/video.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/modalities/video_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/modality.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/modality_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/natural_language.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/natural_language_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/sampling.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/sampling_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/__init__.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/completion.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/completion_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/description.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/description_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/function_generation.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/function_generation_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/mapping.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/mapping_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/parsing.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/parsing_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/prompting.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/prompting_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/schema.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/schema_generation.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/schema_generation_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/schema_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/scoring.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/scoring_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/subscription.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/subscription_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/template.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/template_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/__init__.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/completion.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/completion_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/conversation.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/conversation_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/demonstration.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/demonstration_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/selfplay.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/selfplay_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/text_formatting.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/text_formatting_test.py +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun.egg-info/SOURCES.txt +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun.egg-info/dependency_links.txt +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun.egg-info/requires.txt +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun.egg-info/top_level.txt +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/setup.cfg +0 -0
- {langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/setup.py +0 -0
@@ -35,25 +35,39 @@ from langfun.core.llms.google_genai import Palm2_IT
|
|
35
35
|
# OpenAI models.
|
36
36
|
from langfun.core.llms.openai import OpenAI
|
37
37
|
|
38
|
+
from langfun.core.llms.openai import Gpt4o
|
39
|
+
from langfun.core.llms.openai import Gpt4o_20240513
|
40
|
+
|
38
41
|
from langfun.core.llms.openai import Gpt4Turbo
|
39
42
|
from langfun.core.llms.openai import Gpt4Turbo_20240409
|
40
43
|
from langfun.core.llms.openai import Gpt4TurboPreview
|
41
|
-
from langfun.core.llms.openai import
|
42
|
-
from langfun.core.llms.openai import
|
44
|
+
from langfun.core.llms.openai import Gpt4TurboPreview_20240125
|
45
|
+
from langfun.core.llms.openai import Gpt4TurboPreview_20231106
|
43
46
|
from langfun.core.llms.openai import Gpt4VisionPreview
|
44
|
-
from langfun.core.llms.openai import
|
47
|
+
from langfun.core.llms.openai import Gpt4VisionPreview_20231106
|
45
48
|
from langfun.core.llms.openai import Gpt4
|
46
|
-
from langfun.core.llms.openai import
|
49
|
+
from langfun.core.llms.openai import Gpt4_20230613
|
50
|
+
|
47
51
|
from langfun.core.llms.openai import Gpt4_32K
|
48
|
-
from langfun.core.llms.openai import
|
52
|
+
from langfun.core.llms.openai import Gpt4_32K_20230613
|
49
53
|
|
50
54
|
from langfun.core.llms.openai import Gpt35Turbo
|
51
|
-
from langfun.core.llms.openai import
|
52
|
-
from langfun.core.llms.openai import
|
53
|
-
from langfun.core.llms.openai import
|
55
|
+
from langfun.core.llms.openai import Gpt35Turbo_20240125
|
56
|
+
from langfun.core.llms.openai import Gpt35Turbo_20231106
|
57
|
+
from langfun.core.llms.openai import Gpt35Turbo_20230613
|
54
58
|
from langfun.core.llms.openai import Gpt35Turbo16K
|
55
|
-
from langfun.core.llms.openai import
|
56
|
-
|
59
|
+
from langfun.core.llms.openai import Gpt35Turbo16K_20230613
|
60
|
+
|
61
|
+
# For backward compatibility.
|
62
|
+
Gpt4TurboPreview_0125 = Gpt4TurboPreview_20240125
|
63
|
+
Gpt4TurboPreview_1106 = Gpt4TurboPreview_20231106
|
64
|
+
Gpt4VisionPreview_1106 = Gpt4VisionPreview_20231106
|
65
|
+
Gpt4_0613 = Gpt4_20230613
|
66
|
+
Gpt4_32K_0613 = Gpt4_32K_20230613
|
67
|
+
Gpt35Turbo_0125 = Gpt35Turbo_20240125
|
68
|
+
Gpt35Turbo_1106 = Gpt35Turbo_20231106
|
69
|
+
Gpt35Turbo_0613 = Gpt35Turbo_20230613
|
70
|
+
Gpt35Turbo16K_0613 = Gpt35Turbo16K_20230613
|
57
71
|
|
58
72
|
from langfun.core.llms.openai import Gpt35
|
59
73
|
|
@@ -33,15 +33,18 @@ _DEFAULT_RPM = 3000
|
|
33
33
|
SUPPORTED_MODELS_AND_SETTINGS = {
|
34
34
|
# Models from https://platform.openai.com/docs/models
|
35
35
|
# RPM is from https://platform.openai.com/docs/guides/rate-limits
|
36
|
+
# GPT-4o models
|
37
|
+
'gpt-4o': pg.Dict(rpm=10000, tpm=5000000),
|
38
|
+
'gpt-4o-2024-05-13': pg.Dict(rpm=10000, tpm=5000000),
|
36
39
|
# GPT-4-Turbo models
|
37
|
-
'gpt-4-turbo': pg.Dict(rpm=10000, tpm=
|
38
|
-
'gpt-4-turbo-2024-04-09': pg.Dict(rpm=10000, tpm=
|
39
|
-
'gpt-4-turbo-preview': pg.Dict(rpm=10000, tpm=
|
40
|
-
'gpt-4-0125-preview': pg.Dict(rpm=10000, tpm=
|
41
|
-
'gpt-4-1106-preview': pg.Dict(rpm=10000, tpm=
|
42
|
-
'gpt-4-vision-preview': pg.Dict(rpm=10000, tpm=
|
40
|
+
'gpt-4-turbo': pg.Dict(rpm=10000, tpm=2000000),
|
41
|
+
'gpt-4-turbo-2024-04-09': pg.Dict(rpm=10000, tpm=2000000),
|
42
|
+
'gpt-4-turbo-preview': pg.Dict(rpm=10000, tpm=2000000),
|
43
|
+
'gpt-4-0125-preview': pg.Dict(rpm=10000, tpm=2000000),
|
44
|
+
'gpt-4-1106-preview': pg.Dict(rpm=10000, tpm=2000000),
|
45
|
+
'gpt-4-vision-preview': pg.Dict(rpm=10000, tpm=2000000),
|
43
46
|
'gpt-4-1106-vision-preview': pg.Dict(
|
44
|
-
rpm=10000, tpm=
|
47
|
+
rpm=10000, tpm=2000000
|
45
48
|
),
|
46
49
|
# GPT-4 models
|
47
50
|
'gpt-4': pg.Dict(rpm=10000, tpm=300000),
|
@@ -309,12 +312,12 @@ class Gpt4TurboPreview(Gpt4):
|
|
309
312
|
model = 'gpt-4-turbo-preview'
|
310
313
|
|
311
314
|
|
312
|
-
class
|
315
|
+
class Gpt4TurboPreview_20240125(Gpt4TurboPreview): # pylint: disable=invalid-name
|
313
316
|
"""GPT-4 Turbo Preview with 128k context window. Knowledge up to Dec. 2023."""
|
314
317
|
model = 'gpt-4-0125-preview'
|
315
318
|
|
316
319
|
|
317
|
-
class
|
320
|
+
class Gpt4TurboPreview_20231106(Gpt4TurboPreview): # pylint: disable=invalid-name
|
318
321
|
"""GPT-4 Turbo Preview with 128k context window. Knowledge up to Apr. 2023."""
|
319
322
|
model = 'gpt-4-1106-preview'
|
320
323
|
|
@@ -325,12 +328,12 @@ class Gpt4VisionPreview(Gpt4):
|
|
325
328
|
multimodal = True
|
326
329
|
|
327
330
|
|
328
|
-
class
|
331
|
+
class Gpt4VisionPreview_20231106(Gpt4): # pylint: disable=invalid-name
|
329
332
|
"""GPT-4 Turbo vision preview. 128k context window. Knowledge to Apr. 2023."""
|
330
333
|
model = 'gpt-4-1106-vision-preview'
|
331
334
|
|
332
335
|
|
333
|
-
class
|
336
|
+
class Gpt4_20230613(Gpt4): # pylint:disable=invalid-name
|
334
337
|
"""GPT-4 @20230613. 8K context window. Knowledge up to 9-2021."""
|
335
338
|
model = 'gpt-4-0613'
|
336
339
|
|
@@ -340,11 +343,23 @@ class Gpt4_32K(Gpt4): # pylint:disable=invalid-name
|
|
340
343
|
model = 'gpt-4-32k'
|
341
344
|
|
342
345
|
|
343
|
-
class
|
346
|
+
class Gpt4_32K_20230613(Gpt4_32K): # pylint:disable=invalid-name
|
344
347
|
"""GPT-4 @20230613. 32K context window. Knowledge up to 9-2021."""
|
345
348
|
model = 'gpt-4-32k-0613'
|
346
349
|
|
347
350
|
|
351
|
+
class Gpt4o(OpenAI):
|
352
|
+
"""GPT-4o."""
|
353
|
+
model = 'gpt-4o'
|
354
|
+
multimodal = True
|
355
|
+
|
356
|
+
|
357
|
+
class Gpt4o_20240513(OpenAI): # pylint:disable=invalid-name
|
358
|
+
"""GPT-4o."""
|
359
|
+
model = 'gpt-4o-2024-05-13'
|
360
|
+
multimodal = True
|
361
|
+
|
362
|
+
|
348
363
|
class Gpt35(OpenAI):
|
349
364
|
"""GPT-3.5. 4K max tokens, trained up on data up to Sep, 2021."""
|
350
365
|
model = 'text-davinci-003'
|
@@ -355,17 +370,17 @@ class Gpt35Turbo(Gpt35):
|
|
355
370
|
model = 'gpt-3.5-turbo'
|
356
371
|
|
357
372
|
|
358
|
-
class
|
373
|
+
class Gpt35Turbo_20240125(Gpt35Turbo): # pylint:disable=invalid-name
|
359
374
|
"""GPT-3.5 Turbo @20240125. 16K context window. Knowledge up to 09/2021."""
|
360
375
|
model = 'gpt-3.5-turbo-0125'
|
361
376
|
|
362
377
|
|
363
|
-
class
|
378
|
+
class Gpt35Turbo_20231106(Gpt35Turbo): # pylint:disable=invalid-name
|
364
379
|
"""Gpt3.5 Turbo @20231106. 16K context window. Knowledge up to 09/2021."""
|
365
380
|
model = 'gpt-3.5-turbo-1106'
|
366
381
|
|
367
382
|
|
368
|
-
class
|
383
|
+
class Gpt35Turbo_20230613(Gpt35Turbo): # pylint:disable=invalid-name
|
369
384
|
"""Gpt3.5 Turbo snapshot at 2023/06/13, with 4K context window size."""
|
370
385
|
model = 'gpt-3.5-turbo-0613'
|
371
386
|
|
@@ -375,7 +390,7 @@ class Gpt35Turbo16K(Gpt35Turbo):
|
|
375
390
|
model = 'gpt-3.5-turbo-16k'
|
376
391
|
|
377
392
|
|
378
|
-
class
|
393
|
+
class Gpt35Turbo16K_20230613(Gpt35Turbo): # pylint:disable=invalid-name
|
379
394
|
"""Gtp 3.5 Turbo 16K 0613."""
|
380
395
|
model = 'gpt-3.5-turbo-16k-0613'
|
381
396
|
|
@@ -99,7 +99,7 @@ class VertexAI(lf.LanguageModel):
|
|
99
99
|
|
100
100
|
credentials = self.credentials
|
101
101
|
# Placeholder for Google-internal credentials.
|
102
|
-
|
102
|
+
import vertexai
|
103
103
|
vertexai.init(project=project, location=location, credentials=credentials)
|
104
104
|
return True
|
105
105
|
|
@@ -125,7 +125,7 @@ class VertexAI(lf.LanguageModel):
|
|
125
125
|
self, options: lf.LMSamplingOptions
|
126
126
|
) -> Any: # generative_models.GenerationConfig
|
127
127
|
"""Creates generation config from langfun sampling options."""
|
128
|
-
from
|
128
|
+
from vertexai import generative_models
|
129
129
|
return generative_models.GenerationConfig(
|
130
130
|
temperature=options.temperature,
|
131
131
|
top_p=options.top_p,
|
@@ -138,7 +138,7 @@ class VertexAI(lf.LanguageModel):
|
|
138
138
|
self, prompt: lf.Message
|
139
139
|
) -> list[str | Any]:
|
140
140
|
"""Gets generation input from langfun message."""
|
141
|
-
from
|
141
|
+
from vertexai import generative_models
|
142
142
|
chunks = []
|
143
143
|
for lf_chunk in prompt.chunk():
|
144
144
|
if isinstance(lf_chunk, str):
|
@@ -239,7 +239,7 @@ class _ModelHub:
|
|
239
239
|
"""Gets a generative model by model id."""
|
240
240
|
model = self._generative_model_cache.get(model_id, None)
|
241
241
|
if model is None:
|
242
|
-
from
|
242
|
+
from vertexai import generative_models
|
243
243
|
model = generative_models.GenerativeModel(model_id)
|
244
244
|
self._generative_model_cache[model_id] = model
|
245
245
|
return model
|
@@ -250,7 +250,7 @@ class _ModelHub:
|
|
250
250
|
"""Gets a text generation model by model id."""
|
251
251
|
model = self._text_generation_model_cache.get(model_id, None)
|
252
252
|
if model is None:
|
253
|
-
from
|
253
|
+
from vertexai import language_models
|
254
254
|
model = language_models.TextGenerationModel.from_pretrained(model_id)
|
255
255
|
self._text_generation_model_cache[model_id] = model
|
256
256
|
return model
|
@@ -17,7 +17,7 @@ import os
|
|
17
17
|
import unittest
|
18
18
|
from unittest import mock
|
19
19
|
|
20
|
-
from
|
20
|
+
from vertexai import generative_models
|
21
21
|
import langfun.core as lf
|
22
22
|
from langfun.core import modalities as lf_modalities
|
23
23
|
from langfun.core.llms import vertexai
|
@@ -39,7 +39,6 @@ example_image = (
|
|
39
39
|
def mock_generate_content(content, generation_config, **kwargs):
|
40
40
|
del kwargs
|
41
41
|
c = pg.Dict(generation_config.to_dict())
|
42
|
-
print('zzz', c)
|
43
42
|
return generative_models.GenerationResponse.from_dict({
|
44
43
|
'candidates': [
|
45
44
|
{
|
@@ -111,7 +110,7 @@ class VertexAITest(unittest.TestCase):
|
|
111
110
|
|
112
111
|
def test_model_hub(self):
|
113
112
|
with mock.patch(
|
114
|
-
'
|
113
|
+
'vertexai.generative_models.'
|
115
114
|
'GenerativeModel.__init__'
|
116
115
|
) as mock_model_init:
|
117
116
|
mock_model_init.side_effect = lambda *args, **kwargs: None
|
@@ -125,7 +124,7 @@ class VertexAITest(unittest.TestCase):
|
|
125
124
|
)
|
126
125
|
|
127
126
|
with mock.patch(
|
128
|
-
'
|
127
|
+
'vertexai.language_models.'
|
129
128
|
'TextGenerationModel.from_pretrained'
|
130
129
|
) as mock_model_init:
|
131
130
|
|
@@ -163,13 +162,13 @@ class VertexAITest(unittest.TestCase):
|
|
163
162
|
|
164
163
|
def test_call_generative_model(self):
|
165
164
|
with mock.patch(
|
166
|
-
'
|
165
|
+
'vertexai.generative_models.'
|
167
166
|
'GenerativeModel.__init__'
|
168
167
|
) as mock_model_init:
|
169
168
|
mock_model_init.side_effect = lambda *args, **kwargs: None
|
170
169
|
|
171
170
|
with mock.patch(
|
172
|
-
'
|
171
|
+
'vertexai.generative_models.'
|
173
172
|
'GenerativeModel.generate_content'
|
174
173
|
) as mock_generate:
|
175
174
|
mock_generate.side_effect = mock_generate_content
|
@@ -192,7 +191,7 @@ class VertexAITest(unittest.TestCase):
|
|
192
191
|
|
193
192
|
def test_call_text_generation_model(self):
|
194
193
|
with mock.patch(
|
195
|
-
'
|
194
|
+
'vertexai.language_models.'
|
196
195
|
'TextGenerationModel.from_pretrained'
|
197
196
|
) as mock_model_init:
|
198
197
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/__init__.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/correction.py
RENAMED
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/errors.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/errors_test.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/execution.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/execution_test.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/generation.py
RENAMED
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/parsing.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/parsing_test.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/coding/python/permissions.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/cache/in_memory.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/cache/in_memory_test.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/llms/google_genai_test.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/modalities/image_test.py
RENAMED
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/modalities/mime_test.py
RENAMED
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/modalities/video_test.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/natural_language_test.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/completion.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/completion_test.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/description.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/description_test.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/mapping_test.py
RENAMED
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/parsing_test.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/prompting.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/prompting_test.py
RENAMED
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/schema_generation.py
RENAMED
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/schema_test.py
RENAMED
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/structured/scoring_test.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/completion.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/completion_test.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/conversation.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/conversation_test.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/demonstration.py
RENAMED
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/demonstration_test.py
RENAMED
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/templates/selfplay_test.py
RENAMED
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun/core/text_formatting_test.py
RENAMED
File without changes
|
File without changes
|
{langfun-0.0.2.dev20240513 → langfun-0.0.2.dev20240516}/langfun.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|