langfun 0.0.2.dev20240514__py3-none-any.whl → 0.0.2.dev20240515__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.

@@ -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 Gpt4TurboPreview_0125
42
- from langfun.core.llms.openai import Gpt4TurboPreview_1106
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 Gpt4VisionPreview_1106
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 Gpt4_0613
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 Gpt4_32K_0613
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 Gpt35Turbo_0125
52
- from langfun.core.llms.openai import Gpt35Turbo_1106
53
- from langfun.core.llms.openai import Gpt35Turbo_0613
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 Gpt35Turbo16K_0613
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,7 +33,9 @@ _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-4-Turbo models
36
+ 'gpt-4o': pg.Dict(rpm=10000, tpm=1500000),
37
+ 'gpt-4o-2024-05-13': pg.Dict(rpm=10000, tpm=1500000),
38
+ # GPT-4-Turbo models.
37
39
  'gpt-4-turbo': pg.Dict(rpm=10000, tpm=1500000),
38
40
  'gpt-4-turbo-2024-04-09': pg.Dict(rpm=10000, tpm=1500000),
39
41
  'gpt-4-turbo-preview': pg.Dict(rpm=10000, tpm=1500000),
@@ -309,12 +311,12 @@ class Gpt4TurboPreview(Gpt4):
309
311
  model = 'gpt-4-turbo-preview'
310
312
 
311
313
 
312
- class Gpt4TurboPreview_0125(Gpt4TurboPreview): # pylint: disable=invalid-name
314
+ class Gpt4TurboPreview_20240125(Gpt4TurboPreview): # pylint: disable=invalid-name
313
315
  """GPT-4 Turbo Preview with 128k context window. Knowledge up to Dec. 2023."""
314
316
  model = 'gpt-4-0125-preview'
315
317
 
316
318
 
317
- class Gpt4TurboPreview_1106(Gpt4TurboPreview): # pylint: disable=invalid-name
319
+ class Gpt4TurboPreview_20231106(Gpt4TurboPreview): # pylint: disable=invalid-name
318
320
  """GPT-4 Turbo Preview with 128k context window. Knowledge up to Apr. 2023."""
319
321
  model = 'gpt-4-1106-preview'
320
322
 
@@ -325,12 +327,12 @@ class Gpt4VisionPreview(Gpt4):
325
327
  multimodal = True
326
328
 
327
329
 
328
- class Gpt4VisionPreview_1106(Gpt4): # pylint: disable=invalid-name
330
+ class Gpt4VisionPreview_20231106(Gpt4): # pylint: disable=invalid-name
329
331
  """GPT-4 Turbo vision preview. 128k context window. Knowledge to Apr. 2023."""
330
332
  model = 'gpt-4-1106-vision-preview'
331
333
 
332
334
 
333
- class Gpt4_0613(Gpt4): # pylint:disable=invalid-name
335
+ class Gpt4_20230613(Gpt4): # pylint:disable=invalid-name
334
336
  """GPT-4 @20230613. 8K context window. Knowledge up to 9-2021."""
335
337
  model = 'gpt-4-0613'
336
338
 
@@ -340,11 +342,23 @@ class Gpt4_32K(Gpt4): # pylint:disable=invalid-name
340
342
  model = 'gpt-4-32k'
341
343
 
342
344
 
343
- class Gpt4_32K_0613(Gpt4_32K): # pylint:disable=invalid-name
345
+ class Gpt4_32K_20230613(Gpt4_32K): # pylint:disable=invalid-name
344
346
  """GPT-4 @20230613. 32K context window. Knowledge up to 9-2021."""
345
347
  model = 'gpt-4-32k-0613'
346
348
 
347
349
 
350
+ class Gpt4o(OpenAI):
351
+ """GPT-4o."""
352
+ model = 'gpt-4o'
353
+ multimodal = True
354
+
355
+
356
+ class Gpt4o_20240513(OpenAI): # pylint:disable=invalid-name
357
+ """GPT-4o."""
358
+ model = 'gpt-4o-2024-05-13'
359
+ multimodal = True
360
+
361
+
348
362
  class Gpt35(OpenAI):
349
363
  """GPT-3.5. 4K max tokens, trained up on data up to Sep, 2021."""
350
364
  model = 'text-davinci-003'
@@ -355,17 +369,17 @@ class Gpt35Turbo(Gpt35):
355
369
  model = 'gpt-3.5-turbo'
356
370
 
357
371
 
358
- class Gpt35Turbo_0125(Gpt35Turbo): # pylint:disable=invalid-name
372
+ class Gpt35Turbo_20240125(Gpt35Turbo): # pylint:disable=invalid-name
359
373
  """GPT-3.5 Turbo @20240125. 16K context window. Knowledge up to 09/2021."""
360
374
  model = 'gpt-3.5-turbo-0125'
361
375
 
362
376
 
363
- class Gpt35Turbo_1106(Gpt35Turbo): # pylint:disable=invalid-name
377
+ class Gpt35Turbo_20231106(Gpt35Turbo): # pylint:disable=invalid-name
364
378
  """Gpt3.5 Turbo @20231106. 16K context window. Knowledge up to 09/2021."""
365
379
  model = 'gpt-3.5-turbo-1106'
366
380
 
367
381
 
368
- class Gpt35Turbo_0613(Gpt35Turbo): # pylint:disable=invalid-name
382
+ class Gpt35Turbo_20230613(Gpt35Turbo): # pylint:disable=invalid-name
369
383
  """Gpt3.5 Turbo snapshot at 2023/06/13, with 4K context window size."""
370
384
  model = 'gpt-3.5-turbo-0613'
371
385
 
@@ -375,7 +389,7 @@ class Gpt35Turbo16K(Gpt35Turbo):
375
389
  model = 'gpt-3.5-turbo-16k'
376
390
 
377
391
 
378
- class Gpt35Turbo16K_0613(Gpt35Turbo): # pylint:disable=invalid-name
392
+ class Gpt35Turbo16K_20230613(Gpt35Turbo): # pylint:disable=invalid-name
379
393
  """Gtp 3.5 Turbo 16K 0613."""
380
394
  model = 'gpt-3.5-turbo-16k-0613'
381
395
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langfun
3
- Version: 0.0.2.dev20240514
3
+ Version: 0.0.2.dev20240515
4
4
  Summary: Langfun: Language as Functions.
5
5
  Home-page: https://github.com/google/langfun
6
6
  Author: Langfun Authors
@@ -48,7 +48,7 @@ langfun/core/eval/patching.py,sha256=R0s2eAd1m97exQt06dmUL0V_MBG0W2Hxg7fhNB7cXW0
48
48
  langfun/core/eval/patching_test.py,sha256=8kCd54Egjju22FMgtJuxEsrXkW8ifs-UUBHtrCG1L6w,4775
49
49
  langfun/core/eval/scoring.py,sha256=1J7IATo-8FXUR0SBqk9icztHiM0lWkBFcWUo-vUURgQ,6376
50
50
  langfun/core/eval/scoring_test.py,sha256=O8olHbrUEg60gMxwOkWzKBJZpZoUlmVnBANX5Se2SXM,4546
51
- langfun/core/llms/__init__.py,sha256=C-NrcgFqf3_EP_dN8oADdckQ-rfPKZhsjeSf86kJpLk,3642
51
+ langfun/core/llms/__init__.py,sha256=h_kam-0fjWISAQ90KZ_ydBhwADVCzrhLPXmAki3GfU0,4175
52
52
  langfun/core/llms/anthropic.py,sha256=7W9YdPN3SlAFhAIQlihMkrpo7tTY_4NvD0KIlCrqcsk,8505
53
53
  langfun/core/llms/anthropic_test.py,sha256=TMM30myyEhwF99Le4RvJEXOn8RYl0q1FRkt9Q9nl1jk,5540
54
54
  langfun/core/llms/fake.py,sha256=_smsN_CsYbeWrtjpegEPwdAPV9mwaIuH_4oZGeXQwQI,2896
@@ -59,7 +59,7 @@ langfun/core/llms/groq.py,sha256=NaGItVL_pkOpqPpI4bPGU27xLFRoaeizZ49v2s-4ERs,784
59
59
  langfun/core/llms/groq_test.py,sha256=M6GtlrsOvDun_j-sR8cPh4W_moHWZNSTiThu3kuwbbc,5281
60
60
  langfun/core/llms/llama_cpp.py,sha256=Y_KkMUf3Xfac49koMUtUslKl3h-HWp3-ntq7Jaa3bdo,2385
61
61
  langfun/core/llms/llama_cpp_test.py,sha256=ZxC6defGd_HX9SFRU9U4cJiQnBKundbOrchbXuC1Z2M,1683
62
- langfun/core/llms/openai.py,sha256=u2lqYcKFjFxLfWYD0KLT3YThqcoo66rWs3n0bcuSYBs,13286
62
+ langfun/core/llms/openai.py,sha256=u5hlpQlmYvdcuU_TiqH0ektQ0lHD09M3xByE7dIhqrs,13638
63
63
  langfun/core/llms/openai_test.py,sha256=asSA1sVy_7hnXioD_2HTxtSDpVTKBUO_EjZuyHpwbn0,14854
64
64
  langfun/core/llms/vertexai.py,sha256=O2Lp-F4KJzvQSCjPV--sa6nMS9-GsLj2eiqA-1qGhWQ,9661
65
65
  langfun/core/llms/vertexai_test.py,sha256=LBk4luL_N13ZejZebBzQ3tkfjxFhk7uBS4JjEpojJAo,7836
@@ -105,8 +105,8 @@ langfun/core/templates/demonstration.py,sha256=vCrgYubdZM5Umqcgp8NUVGXgr4P_c-fik
105
105
  langfun/core/templates/demonstration_test.py,sha256=SafcDQ0WgI7pw05EmPI2S4v1t3ABKzup8jReCljHeK4,2162
106
106
  langfun/core/templates/selfplay.py,sha256=yhgrJbiYwq47TgzThmHrDQTF4nDrTI09CWGhuQPNv-s,2273
107
107
  langfun/core/templates/selfplay_test.py,sha256=DYVrkk7uNKCqJGEHH31HssU2BPuMItU1vJLzfcXIlYg,2156
108
- langfun-0.0.2.dev20240514.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
109
- langfun-0.0.2.dev20240514.dist-info/METADATA,sha256=DOQe0LBigfl1Lk0WWtih781_jjlcP2BJUboWFwxDbek,3452
110
- langfun-0.0.2.dev20240514.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
111
- langfun-0.0.2.dev20240514.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
112
- langfun-0.0.2.dev20240514.dist-info/RECORD,,
108
+ langfun-0.0.2.dev20240515.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
109
+ langfun-0.0.2.dev20240515.dist-info/METADATA,sha256=wx28EHVqDU4Xz2qt4i8JYirho8VkBqCb5URcoKVfmhA,3452
110
+ langfun-0.0.2.dev20240515.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
111
+ langfun-0.0.2.dev20240515.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
112
+ langfun-0.0.2.dev20240515.dist-info/RECORD,,