langfun 0.1.2.dev202507230804__py3-none-any.whl → 0.1.2.dev202507240805__py3-none-any.whl
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.
Potentially problematic release.
This version of langfun might be problematic. Click here for more details.
- langfun/core/llms/google_genai.py +6 -0
- langfun/core/llms/vertexai.py +5 -2
- {langfun-0.1.2.dev202507230804.dist-info → langfun-0.1.2.dev202507240805.dist-info}/METADATA +1 -1
- {langfun-0.1.2.dev202507230804.dist-info → langfun-0.1.2.dev202507240805.dist-info}/RECORD +7 -7
- {langfun-0.1.2.dev202507230804.dist-info → langfun-0.1.2.dev202507240805.dist-info}/WHEEL +0 -0
- {langfun-0.1.2.dev202507230804.dist-info → langfun-0.1.2.dev202507240805.dist-info}/licenses/LICENSE +0 -0
- {langfun-0.1.2.dev202507230804.dist-info → langfun-0.1.2.dev202507240805.dist-info}/top_level.txt +0 -0
|
@@ -61,6 +61,12 @@ class GenAI(gemini.Gemini):
|
|
|
61
61
|
override=dict(provider='Google GenAI')
|
|
62
62
|
)
|
|
63
63
|
|
|
64
|
+
def session(self):
|
|
65
|
+
assert self._api_initialized
|
|
66
|
+
s = self._session()
|
|
67
|
+
s.headers.update(self.headers or {})
|
|
68
|
+
return s
|
|
69
|
+
|
|
64
70
|
@property
|
|
65
71
|
def api_endpoint(self) -> str:
|
|
66
72
|
api_key = self.api_key or os.environ.get('GOOGLE_API_KEY', None)
|
langfun/core/llms/vertexai.py
CHANGED
|
@@ -131,10 +131,13 @@ class VertexAI(rest.REST):
|
|
|
131
131
|
)
|
|
132
132
|
self._credentials = credentials
|
|
133
133
|
|
|
134
|
-
def
|
|
134
|
+
def session(self):
|
|
135
|
+
assert self._api_initialized
|
|
135
136
|
assert self._credentials is not None
|
|
136
137
|
assert auth_requests is not None
|
|
137
|
-
|
|
138
|
+
s = auth_requests.AuthorizedSession(self._credentials)
|
|
139
|
+
s.headers.update(self.headers or {})
|
|
140
|
+
return s
|
|
138
141
|
|
|
139
142
|
def _sample_single(self, prompt: lf.Message) -> lf.LMSamplingResult:
|
|
140
143
|
assert auth_exceptions is not None
|
|
@@ -94,7 +94,7 @@ langfun/core/llms/fake.py,sha256=xmgCkk9y0I4x0IT32SZ9_OT27aLadXH8PRiYNo5VTd4,326
|
|
|
94
94
|
langfun/core/llms/fake_test.py,sha256=2h13qkwEz_JR0mtUDPxdAhQo7MueXaFSwsD2DIRDW9g,7653
|
|
95
95
|
langfun/core/llms/gemini.py,sha256=umrEJGnZb_U4CCbFHicaoVsBuEdZGg7QGNkr-mSJidw,29061
|
|
96
96
|
langfun/core/llms/gemini_test.py,sha256=y1s0W65SrdepbZxzgIeoTB2MI7sXnfBDf1NsGn57LbM,7617
|
|
97
|
-
langfun/core/llms/google_genai.py,sha256=
|
|
97
|
+
langfun/core/llms/google_genai.py,sha256=3VbNMQORUBSTzFAMY_6c4Nd9tesP9lGoKMrlP9m-80c,5787
|
|
98
98
|
langfun/core/llms/google_genai_test.py,sha256=NKNtpebArQ9ZR7Qsnhd2prFIpMjleojy6o6VMXkJ1zY,1502
|
|
99
99
|
langfun/core/llms/groq.py,sha256=S9V10kFo3cgX89qPgt_umq-SpRnxEDLTt_hJmpERfbo,12066
|
|
100
100
|
langfun/core/llms/groq_test.py,sha256=P4EgexCqsh4K2x11w0UL_vz-YYNaPdQU0WsDAdnTRQ8,2045
|
|
@@ -106,7 +106,7 @@ langfun/core/llms/openai_compatible_test.py,sha256=KwOMA7tsmOxFBjezltkBDSU77AvOQ
|
|
|
106
106
|
langfun/core/llms/openai_test.py,sha256=gwuO6aoa296iM2welWV9ua4KF8gEVGsEPakgbtkWkFQ,2687
|
|
107
107
|
langfun/core/llms/rest.py,sha256=mY9n0sMAtf0RsvTBgbYHDxGzGD9WLIkocALEHXAL5r4,4583
|
|
108
108
|
langfun/core/llms/rest_test.py,sha256=_zM7nV8DEVyoXNiQOnuwJ917mWjki0614H88rNmDboE,5020
|
|
109
|
-
langfun/core/llms/vertexai.py,sha256=
|
|
109
|
+
langfun/core/llms/vertexai.py,sha256=4oE3coQtkNB43ATvwQAaVX7YqWXdnHZoKVM8lde8EpU,20000
|
|
110
110
|
langfun/core/llms/vertexai_test.py,sha256=_e-acnNBAf9C3WO6i1b2J_mhRzdDdYQTorD9hIVZKOg,5034
|
|
111
111
|
langfun/core/llms/cache/__init__.py,sha256=QAo3InUMDM_YpteNnVCSejI4zOsnjSMWKJKzkb3VY64,993
|
|
112
112
|
langfun/core/llms/cache/base.py,sha256=rt3zwmyw0y9jsSGW-ZbV1vAfLxQ7_3AVk0l2EySlse4,3918
|
|
@@ -156,8 +156,8 @@ langfun/core/templates/demonstration.py,sha256=vCrgYubdZM5Umqcgp8NUVGXgr4P_c-fik
|
|
|
156
156
|
langfun/core/templates/demonstration_test.py,sha256=SafcDQ0WgI7pw05EmPI2S4v1t3ABKzup8jReCljHeK4,2162
|
|
157
157
|
langfun/core/templates/selfplay.py,sha256=yhgrJbiYwq47TgzThmHrDQTF4nDrTI09CWGhuQPNv-s,2273
|
|
158
158
|
langfun/core/templates/selfplay_test.py,sha256=Ot__1P1M8oJfoTp-M9-PQ6HUXqZKyMwvZ5f7yQ3yfyM,2326
|
|
159
|
-
langfun-0.1.2.
|
|
160
|
-
langfun-0.1.2.
|
|
161
|
-
langfun-0.1.2.
|
|
162
|
-
langfun-0.1.2.
|
|
163
|
-
langfun-0.1.2.
|
|
159
|
+
langfun-0.1.2.dev202507240805.dist-info/licenses/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
|
|
160
|
+
langfun-0.1.2.dev202507240805.dist-info/METADATA,sha256=UwBPFQ2MnEUzp2f6cUi_579SS3c5s_j5OOU-dsBZstw,7380
|
|
161
|
+
langfun-0.1.2.dev202507240805.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
162
|
+
langfun-0.1.2.dev202507240805.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
|
|
163
|
+
langfun-0.1.2.dev202507240805.dist-info/RECORD,,
|
|
File without changes
|
{langfun-0.1.2.dev202507230804.dist-info → langfun-0.1.2.dev202507240805.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{langfun-0.1.2.dev202507230804.dist-info → langfun-0.1.2.dev202507240805.dist-info}/top_level.txt
RENAMED
|
File without changes
|