chatlas 0.3.0__py3-none-any.whl → 0.4.0__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 chatlas might be problematic. Click here for more details.

@@ -18,7 +18,6 @@ class SubmitInputArgs(TypedDict, total=False):
18
18
  max_tokens: int
19
19
  messages: Iterable[anthropic.types.message_param.MessageParam]
20
20
  model: Union[
21
- str,
22
21
  Literal[
23
22
  "claude-3-5-haiku-latest",
24
23
  "claude-3-5-haiku-20241022",
@@ -32,6 +31,7 @@ class SubmitInputArgs(TypedDict, total=False):
32
31
  "claude-2.1",
33
32
  "claude-2.0",
34
33
  ],
34
+ str,
35
35
  ]
36
36
  stop_sequences: Union[list[str], anthropic.NotGiven]
37
37
  stream: Union[Literal[False], Literal[True], anthropic.NotGiven]
@@ -3,99 +3,20 @@
3
3
  # ---------------------------------------------------------
4
4
 
5
5
 
6
- from typing import Any, Callable, Iterable, TypedDict, Union
6
+ from typing import Optional, TypedDict, Union
7
7
 
8
- import google.ai.generativelanguage_v1beta.types.content
9
- import google.ai.generativelanguage_v1beta.types.file
10
- import google.ai.generativelanguage_v1beta.types.generative_service
11
- import google.generativeai.types.content_types
12
- import google.generativeai.types.file_types
13
- import google.generativeai.types.generation_types
8
+ import google.auth.credentials
9
+ import google.genai.client
10
+ import google.genai.types
14
11
 
15
12
 
16
13
  class ChatClientArgs(TypedDict, total=False):
17
- model_name: str
18
- generation_config: Union[
19
- google.ai.generativelanguage_v1beta.types.generative_service.GenerationConfig,
20
- google.generativeai.types.generation_types.GenerationConfigDict,
21
- google.generativeai.types.generation_types.GenerationConfig,
22
- None,
23
- ]
24
- tools: Union[
25
- google.generativeai.types.content_types.FunctionLibrary,
26
- Iterable[
27
- Union[
28
- str,
29
- google.generativeai.types.content_types.Tool,
30
- google.ai.generativelanguage_v1beta.types.content.Tool,
31
- google.generativeai.types.content_types.ToolDict,
32
- Iterable[
33
- Union[
34
- google.generativeai.types.content_types.FunctionDeclaration,
35
- google.ai.generativelanguage_v1beta.types.content.FunctionDeclaration,
36
- dict[str, Any],
37
- Callable[..., Any],
38
- ]
39
- ],
40
- google.generativeai.types.content_types.FunctionDeclaration,
41
- google.ai.generativelanguage_v1beta.types.content.FunctionDeclaration,
42
- dict[str, Any],
43
- Callable[..., Any],
44
- ]
45
- ],
46
- str,
47
- google.generativeai.types.content_types.Tool,
48
- google.ai.generativelanguage_v1beta.types.content.Tool,
49
- google.generativeai.types.content_types.ToolDict,
50
- Iterable[
51
- Union[
52
- google.generativeai.types.content_types.FunctionDeclaration,
53
- google.ai.generativelanguage_v1beta.types.content.FunctionDeclaration,
54
- dict[str, Any],
55
- Callable[..., Any],
56
- ]
57
- ],
58
- google.generativeai.types.content_types.FunctionDeclaration,
59
- google.ai.generativelanguage_v1beta.types.content.FunctionDeclaration,
60
- dict[str, Any],
61
- Callable[..., Any],
62
- None,
63
- ]
64
- tool_config: Union[
65
- google.generativeai.types.content_types.ToolConfigDict,
66
- google.ai.generativelanguage_v1beta.types.content.ToolConfig,
67
- None,
68
- ]
69
- system_instruction: Union[
70
- google.ai.generativelanguage_v1beta.types.content.Content,
71
- google.generativeai.types.content_types.ContentDict,
72
- Iterable[
73
- Union[
74
- google.ai.generativelanguage_v1beta.types.content.Part,
75
- google.generativeai.types.content_types.PartDict,
76
- google.ai.generativelanguage_v1beta.types.content.Blob,
77
- google.generativeai.types.content_types.BlobDict,
78
- Any,
79
- str,
80
- google.ai.generativelanguage_v1beta.types.content.FunctionCall,
81
- google.ai.generativelanguage_v1beta.types.content.FunctionResponse,
82
- google.generativeai.types.file_types.FileDataDict,
83
- google.ai.generativelanguage_v1beta.types.content.FileData,
84
- google.ai.generativelanguage_v1beta.types.file.File,
85
- google.generativeai.types.file_types.File,
86
- ]
87
- ],
88
- google.ai.generativelanguage_v1beta.types.content.Part,
89
- google.generativeai.types.content_types.PartDict,
90
- google.ai.generativelanguage_v1beta.types.content.Blob,
91
- google.generativeai.types.content_types.BlobDict,
92
- Any,
93
- str,
94
- google.ai.generativelanguage_v1beta.types.content.FunctionCall,
95
- google.ai.generativelanguage_v1beta.types.content.FunctionResponse,
96
- google.generativeai.types.file_types.FileDataDict,
97
- google.ai.generativelanguage_v1beta.types.content.FileData,
98
- google.ai.generativelanguage_v1beta.types.file.File,
99
- google.generativeai.types.file_types.File,
100
- None,
14
+ vertexai: Optional[bool]
15
+ api_key: Optional[str]
16
+ credentials: Optional[google.auth.credentials.Credentials]
17
+ project: Optional[str]
18
+ location: Optional[str]
19
+ debug_config: Optional[google.genai.client.DebugConfig]
20
+ http_options: Union[
21
+ google.genai.types.HttpOptions, google.genai.types.HttpOptionsDict, None
101
22
  ]
@@ -3,111 +3,64 @@
3
3
  # ---------------------------------------------------------
4
4
 
5
5
 
6
- from typing import Any, Callable, Iterable, TypedDict, Union
6
+ from typing import TypedDict, Union
7
7
 
8
- import google.ai.generativelanguage_v1beta.types.content
9
- import google.ai.generativelanguage_v1beta.types.file
10
- import google.ai.generativelanguage_v1beta.types.generative_service
11
- import google.generativeai.types.content_types
12
- import google.generativeai.types.file_types
13
- import google.generativeai.types.generation_types
14
- import google.generativeai.types.helper_types
8
+ import google.genai.types
9
+ import PIL.Image
15
10
 
16
11
 
17
12
  class SubmitInputArgs(TypedDict, total=False):
13
+ model: str
18
14
  contents: Union[
19
- google.ai.generativelanguage_v1beta.types.content.Content,
20
- google.generativeai.types.content_types.ContentDict,
21
- Iterable[
15
+ list[
22
16
  Union[
23
- google.ai.generativelanguage_v1beta.types.content.Part,
24
- google.generativeai.types.content_types.PartDict,
25
- google.ai.generativelanguage_v1beta.types.content.Blob,
26
- google.generativeai.types.content_types.BlobDict,
27
- Any,
17
+ google.genai.types.Content,
18
+ list[
19
+ Union[
20
+ google.genai.types.File,
21
+ google.genai.types.Part,
22
+ PIL.Image.Image,
23
+ str,
24
+ ]
25
+ ],
26
+ google.genai.types.File,
27
+ google.genai.types.Part,
28
+ PIL.Image.Image,
28
29
  str,
29
- google.ai.generativelanguage_v1beta.types.content.FunctionCall,
30
- google.ai.generativelanguage_v1beta.types.content.FunctionResponse,
31
- google.generativeai.types.file_types.FileDataDict,
32
- google.ai.generativelanguage_v1beta.types.content.FileData,
33
- google.ai.generativelanguage_v1beta.types.file.File,
34
- google.generativeai.types.file_types.File,
35
30
  ]
36
31
  ],
37
- google.ai.generativelanguage_v1beta.types.content.Part,
38
- google.generativeai.types.content_types.PartDict,
39
- google.ai.generativelanguage_v1beta.types.content.Blob,
40
- google.generativeai.types.content_types.BlobDict,
41
- Any,
42
- str,
43
- google.ai.generativelanguage_v1beta.types.content.FunctionCall,
44
- google.ai.generativelanguage_v1beta.types.content.FunctionResponse,
45
- google.generativeai.types.file_types.FileDataDict,
46
- google.ai.generativelanguage_v1beta.types.content.FileData,
47
- google.ai.generativelanguage_v1beta.types.file.File,
48
- google.generativeai.types.file_types.File,
49
- Iterable[
32
+ google.genai.types.Content,
33
+ list[
50
34
  Union[
51
- google.ai.generativelanguage_v1beta.types.content.Content,
52
- google.generativeai.types.content_types.ContentDict,
35
+ google.genai.types.File, google.genai.types.Part, PIL.Image.Image, str
53
36
  ]
54
37
  ],
55
- None,
56
- ]
57
- generation_config: Union[
58
- google.ai.generativelanguage_v1beta.types.generative_service.GenerationConfig,
59
- google.generativeai.types.generation_types.GenerationConfigDict,
60
- google.generativeai.types.generation_types.GenerationConfig,
61
- None,
62
- ]
63
- stream: bool
64
- tools: Union[
65
- google.generativeai.types.content_types.FunctionLibrary,
66
- Iterable[
38
+ google.genai.types.File,
39
+ google.genai.types.Part,
40
+ PIL.Image.Image,
41
+ str,
42
+ list[
67
43
  Union[
68
- str,
69
- google.generativeai.types.content_types.Tool,
70
- google.ai.generativelanguage_v1beta.types.content.Tool,
71
- google.generativeai.types.content_types.ToolDict,
72
- Iterable[
44
+ google.genai.types.Content,
45
+ list[
73
46
  Union[
74
- google.generativeai.types.content_types.FunctionDeclaration,
75
- google.ai.generativelanguage_v1beta.types.content.FunctionDeclaration,
76
- dict[str, Any],
77
- Callable[..., Any],
47
+ google.genai.types.File,
48
+ google.genai.types.Part,
49
+ PIL.Image.Image,
50
+ str,
78
51
  ]
79
52
  ],
80
- google.generativeai.types.content_types.FunctionDeclaration,
81
- google.ai.generativelanguage_v1beta.types.content.FunctionDeclaration,
82
- dict[str, Any],
83
- Callable[..., Any],
84
- ]
85
- ],
86
- str,
87
- google.generativeai.types.content_types.Tool,
88
- google.ai.generativelanguage_v1beta.types.content.Tool,
89
- google.generativeai.types.content_types.ToolDict,
90
- Iterable[
91
- Union[
92
- google.generativeai.types.content_types.FunctionDeclaration,
93
- google.ai.generativelanguage_v1beta.types.content.FunctionDeclaration,
94
- dict[str, Any],
95
- Callable[..., Any],
53
+ google.genai.types.File,
54
+ google.genai.types.Part,
55
+ PIL.Image.Image,
56
+ str,
57
+ google.genai.types.ContentDict,
96
58
  ]
97
59
  ],
98
- google.generativeai.types.content_types.FunctionDeclaration,
99
- google.ai.generativelanguage_v1beta.types.content.FunctionDeclaration,
100
- dict[str, Any],
101
- Callable[..., Any],
102
- None,
103
- ]
104
- tool_config: Union[
105
- google.generativeai.types.content_types.ToolConfigDict,
106
- google.ai.generativelanguage_v1beta.types.content.ToolConfig,
107
- None,
60
+ google.genai.types.ContentDict,
108
61
  ]
109
- request_options: Union[
110
- google.generativeai.types.helper_types.RequestOptions,
111
- google.generativeai.types.helper_types.RequestOptionsDict,
62
+ config: Union[
63
+ google.genai.types.GenerateContentConfig,
64
+ google.genai.types.GenerateContentConfigDict,
112
65
  None,
113
66
  ]
@@ -38,6 +38,8 @@ class SubmitInputArgs(TypedDict, total=False):
38
38
  model: Union[
39
39
  str,
40
40
  Literal[
41
+ "o3-mini",
42
+ "o3-mini-2025-01-31",
41
43
  "o1",
42
44
  "o1-2024-12-17",
43
45
  "o1-preview",
@@ -105,7 +107,7 @@ class SubmitInputArgs(TypedDict, total=False):
105
107
  openai.NotGiven,
106
108
  ]
107
109
  presence_penalty: Union[float, None, openai.NotGiven]
108
- reasoning_effort: Union[Literal["low", "medium", "high"], openai.NotGiven]
110
+ reasoning_effort: Union[Literal["low", "medium", "high"], None, openai.NotGiven]
109
111
  response_format: Union[
110
112
  openai.types.shared_params.response_format_text.ResponseFormatText,
111
113
  openai.types.shared_params.response_format_json_object.ResponseFormatJSONObject,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chatlas
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: A simple and consistent interface for chatting with LLMs
5
5
  Project-URL: Homepage, https://posit-dev.github.io/chatlas
6
6
  Project-URL: Documentation, https://posit-dev.github.io/chatlas
@@ -22,7 +22,7 @@ Requires-Dist: pydantic>=2.0
22
22
  Requires-Dist: rich
23
23
  Provides-Extra: dev
24
24
  Requires-Dist: anthropic[bedrock]; extra == 'dev'
25
- Requires-Dist: google-generativeai>=0.8.3; extra == 'dev'
25
+ Requires-Dist: google-genai>=1.2.0; extra == 'dev'
26
26
  Requires-Dist: matplotlib; extra == 'dev'
27
27
  Requires-Dist: numpy>1.24.4; extra == 'dev'
28
28
  Requires-Dist: openai; extra == 'dev'
@@ -49,7 +49,9 @@ Requires-Dist: pytest>=8.3.2; extra == 'test'
49
49
  Requires-Dist: syrupy>=4; extra == 'test'
50
50
  Description-Content-Type: text/markdown
51
51
 
52
- # chatlas
52
+ <h1 class="unnumbered unlisted"> chatlas <a href="https://posit-dev.github.io/chatlas"><img src="docs/images/logo.png" align="right" height="138" alt="chatlas website" /></a> </h1>
53
+
54
+
53
55
 
54
56
  <p>
55
57
  <!-- badges start -->
@@ -60,11 +62,11 @@ Description-Content-Type: text/markdown
60
62
  </p>
61
63
 
62
64
  chatlas provides a simple and unified interface across large language model (llm) providers in Python.
63
- It abstracts away complexity from common tasks like streaming chat interfaces, tool calling, structured output, and much more.
64
- chatlas helps you prototype faster without painting you into a corner; for example, switching providers is as easy as changing one line of code, but provider specific features are still accessible when needed.
65
- Developer experience is also a key focus of chatlas: typing support, rich console output, and built-in tooling are all included.
65
+ It helps you prototype faster by abstracting away complexity from common tasks like streaming chat interfaces, tool calling, structured output, and much more.
66
+ Switching providers is also as easy as changing one line of code, but you can also reach for provider-specific features when you need them.
67
+ Developer experience is also a key focus of chatlas: typing support, rich console output, and extension points are all included.
66
68
 
67
- (Looking for something similar to chatlas, but in R? Check out [elmer](https://elmer.tidyverse.org/)!)
69
+ (Looking for something similar to chatlas, but in R? Check out [ellmer](https://ellmer.tidyverse.org/)!)
68
70
 
69
71
  ## Install
70
72
 
@@ -96,6 +98,7 @@ It also supports the following enterprise cloud providers:
96
98
 
97
99
  * AWS Bedrock: [`ChatBedrockAnthropic()`](https://posit-dev.github.io/chatlas/reference/ChatBedrockAnthropic.html).
98
100
  * Azure OpenAI: [`ChatAzureOpenAI()`](https://posit-dev.github.io/chatlas/reference/ChatAzureOpenAI.html).
101
+ * Vertex AI: [`ChatVertex()`](https://posit-dev.github.io/chatlas/reference/ChatVertex.html).
99
102
 
100
103
  To use a model provider that isn't listed here, you have two options:
101
104
 
@@ -1,37 +1,38 @@
1
- chatlas/__init__.py,sha256=OJbTO71ne1O9SDxkwIKOMpCMKbh0T8eDpYPFhrAb28A,974
2
- chatlas/_anthropic.py,sha256=ssv6k-XZetwv1hNk7Qs8dAWlcPvElzxjrG0Fh2w50xE,24373
3
- chatlas/_chat.py,sha256=p_MS1LQ-EBlvCzGTbjY5Bdlt1meDsfSbP517blkwSjY,44774
4
- chatlas/_content.py,sha256=vpWF_WKS2tCDUtnL8l9lfW6b6g9e7LbDKP-_TegauVE,5883
1
+ chatlas/__init__.py,sha256=HtvcxTy7A3CO7d6JSZIGDqIPGBRuo7Vte11nazn_VNE,1004
2
+ chatlas/_anthropic.py,sha256=fygtGcKi5qM1w40AZbcnJcsPUkBEyWuqpoyCOKG-kOc,24259
3
+ chatlas/_chat.py,sha256=15j4w1cvFXrqsf7sGMv8B_TidEiow-szbRr6G-HiSqM,45990
4
+ chatlas/_content.py,sha256=79FTmKrByS-rlg6XTbKQh4klaA4O3MJiljMrYrkr1mU,6334
5
5
  chatlas/_content_image.py,sha256=4nk9wTvLtNmtcytdFp8p9otEV5-0_K6wzIxCyK0PIEI,8367
6
6
  chatlas/_display.py,sha256=_IcQcvpyTNjGHOpY70_LOrDWwTjzdkziy6pTvxHEiWI,4053
7
7
  chatlas/_github.py,sha256=D3L7Qu35K-M1qEW7-w-Oq-pF-9mVetia3MHYNNLEYtU,4373
8
- chatlas/_google.py,sha256=jfBp_C_qjbvs48QPE_ykSsfRhjz7htb-G389qLxvSC4,15279
8
+ chatlas/_google.py,sha256=RUXKUChiEqLzhIO3aWQn2dooJEmHNaX8gFK1a5Pzw1Q,18763
9
9
  chatlas/_groq.py,sha256=3VnYiKdxJTHPhEgUKnL2nY5uYL2L4PKBo7GZMwR0D8k,4158
10
10
  chatlas/_interpolate.py,sha256=ykwLP3x-ya9Q33U4knSU75dtk6pzJAeythEEIW-43Pc,3631
11
11
  chatlas/_logging.py,sha256=7a20sAl1PkW1qBNrfd_ieUbQXV8Gf4Vuf0Wn62LNBmk,2290
12
- chatlas/_merge.py,sha256=Xt2uutLdEmYAGfGCa8GCEd8sdNadQM5o3l-zuIQFbWU,3923
12
+ chatlas/_merge.py,sha256=SGj_BetgA7gaOqSBKOhYmW3CYeQKTEehFrXvx3y4OYE,3924
13
13
  chatlas/_ollama.py,sha256=ze-RoHEbf62dYmXDDKjNGqaEZaKCZdcBEyFwQMDQxkQ,3760
14
- chatlas/_openai.py,sha256=nJgp3JJlpxeXn_dhIrXNffQk9vh3ycYy1D2fNip0qEs,24004
14
+ chatlas/_openai.py,sha256=Z1y_NdWr3TyrrFGtvYEaTU7cdMQAqLzMiK67-kIa8vM,23852
15
15
  chatlas/_perplexity.py,sha256=Bw_mlM8N8egGKIrbNerTn2pMlybugADOshjYOfN1ixM,4446
16
- chatlas/_provider.py,sha256=i16I2hkBat1fYEMcFsU0gYNr6Tcg8zJ2xHDnEY7WRY4,4009
16
+ chatlas/_provider.py,sha256=YmdBbz_u5aP_kBxl6s26OPiSnWG_vZ_fvf9L2qvBmyI,3809
17
17
  chatlas/_tokens.py,sha256=3W3EPUp9eWXUiwuzJwEPBv43AUznbK46pm59Htti7z4,2392
18
18
  chatlas/_tokens_old.py,sha256=L9d9oafrXvEx2u4nIn_Jjn7adnQyLBnYBuPwJUE8Pl8,5005
19
19
  chatlas/_tools.py,sha256=-qt4U1AFkebQoX9kpsBy5QXK8a2PpHX6Amgm44gcQ68,4113
20
20
  chatlas/_turn.py,sha256=nKwk20FrOIrZX4xJxdGyUEpwUH2H-UYcoJLlO2ZD5iU,4836
21
21
  chatlas/_typing_extensions.py,sha256=YdzmlyPSBpIEcsOkoz12e6jETT1XEMV2Q72haE4cfwY,1036
22
22
  chatlas/_utils.py,sha256=qAiWuDx-uG8BGFZ_PWvum9wpN-WogdItO32X4pRhhLs,2762
23
- chatlas/types/__init__.py,sha256=pgHl8pd2Ytskd6lkfNtm98Yj1ZP0b3R35RH4Uht2BAs,694
23
+ chatlas/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
+ chatlas/types/__init__.py,sha256=P_EDL4eqsigKwB-u2qRmKlYQS5Y65m7oWjGC3cYmxO4,719
24
25
  chatlas/types/anthropic/__init__.py,sha256=OwubA-DPHYpYo0XyRyAFwftOI0mOxtHzAyhUSLcDx54,417
25
26
  chatlas/types/anthropic/_client.py,sha256=G0LRhoFBcsSOMr5qhP-0rAScsVXaVlHCpggfVp54bnQ,690
26
27
  chatlas/types/anthropic/_client_bedrock.py,sha256=mNazQlu0pQt8JdzrYn3LKNgE4n732GjhQUJdQQK9QkY,785
27
- chatlas/types/anthropic/_submit.py,sha256=BhkJu0OhIMiD3qiUNqJ4litBQCW-7KRr_YZp9Xr9KGA,2091
28
+ chatlas/types/anthropic/_submit.py,sha256=cSSomSJ2zfAHu8ilzMN3XxRTLANh00oK_t5kH6N2lCI,2091
28
29
  chatlas/types/google/__init__.py,sha256=ZJhi8Kwvio2zp8T1TQqmvdHqkS-Khb6BGESPjREADgo,337
29
- chatlas/types/google/_client.py,sha256=YA5hsT-m-KcONKtwpCULYMnGwMPfkScpvhjx_qBLg5o,4421
30
- chatlas/types/google/_submit.py,sha256=yp1wtp5eScLlHDNxeXl0qJOKv7SWLnRQ8oslupRFUBE,4839
30
+ chatlas/types/google/_client.py,sha256=t7aKbxYq_xOA1Z3RnWcjewifdQFSHi7vKEj6MyKMCJk,729
31
+ chatlas/types/google/_submit.py,sha256=b-ZqMvI551Ia7pFlWdqUQJjov3neHmVwLFw-P2bgU8w,1883
31
32
  chatlas/types/openai/__init__.py,sha256=Q2RAr1bSH1nHsxICK05nAmKmxdhKmhbBkWD_XHiVSrI,411
32
33
  chatlas/types/openai/_client.py,sha256=YGm_EHtRSSHeeOZe-CV7oNvMJpEblEta3UTuU7lSRO8,754
33
34
  chatlas/types/openai/_client_azure.py,sha256=jx8D_p46CLDGzTP-k-TtGzj-f3junj6or-86m8DD_0w,858
34
- chatlas/types/openai/_submit.py,sha256=f2o3rNJZcWBhwjomXrs3Mh0V_4vNa9N5eEBkMvJDofQ,6028
35
- chatlas-0.3.0.dist-info/METADATA,sha256=eIPyvdcXpYN4s6txY5GMgBttUsmS5868D10U5zzTchs,13164
36
- chatlas-0.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
37
- chatlas-0.3.0.dist-info/RECORD,,
35
+ chatlas/types/openai/_submit.py,sha256=VX2D1eQHF19XRIt-oq90cBSw_3ChokGpwVG7-b2AJOU,6091
36
+ chatlas-0.4.0.dist-info/METADATA,sha256=-ayykYk3sVvvPRlW6jj15U6S76ywblY0p1sD8trc640,13389
37
+ chatlas-0.4.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
38
+ chatlas-0.4.0.dist-info/RECORD,,