Skip to content

Commit add2c8b

Browse files
authored
feat: Add extra dependencies for every provider that requires them (#66)
* chore(extra): chatlas[anthropic] * chore(extras): chatlas[github] * chore(extras): chatlas[groq] * chore(extras): chatlas[ollama] * chore(extras): chatlas[openai] * chore(extras): chatlas[perplexity] * chat(extras): chatlas[snowflake] * chat(extras): chatlas[google] * chore(extras): chatlas[vertex] and chatlas[bedrock-anthropic] * chore: reformat pip install chatlas commands * docs: add changelog * chore(extras): chatlas[azure-openai]
1 parent bef03a2 commit add2c8b

File tree

10 files changed

+28
-16
lines changed

10 files changed

+28
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
* Updated `ChatAnthropic()`'s `model` default to `"claude-3-7-sonnet-latest"`. (#62)
1919
* The version is now accessible as `chatlas.__version__`. (#64)
20+
* All provider-specific `Chat` subclasses now have an associated extras in chatlas. For example, `ChatOpenAI` has `chatlas[openai]`, `ChatPerplexity` has `chatlas[perplexity]`, `ChatBedrockAnthropic` has `chatlas[bedrock-anthropic]`, and so forth for the other `Chat` classes. (#66)
2021

2122
### Bug fixes
2223

chatlas/_anthropic.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def ChatAnthropic(
7272
::: {.callout-note}
7373
## API key
7474
75-
Note that a Claude Prop membership does not give you the ability to call
75+
Note that a Claude Pro membership does not give you the ability to call
7676
models via the API. You will need to go to the [developer
7777
console](https://console.anthropic.com/account/keys) to sign up (and pay
7878
for) a developer account that will give you an API key that you can use with
@@ -82,7 +82,7 @@ def ChatAnthropic(
8282
::: {.callout-note}
8383
## Python requirements
8484
85-
`ChatAnthropic` requires the `anthropic` package (e.g., `pip install anthropic`).
85+
`ChatAnthropic` requires the `anthropic` package: `pip install "chatlas[anthropic]"`.
8686
:::
8787
8888
Examples
@@ -572,8 +572,8 @@ def ChatBedrockAnthropic(
572572
::: {.callout-note}
573573
## Python requirements
574574
575-
`ChatBedrockAnthropic`, requires the `anthropic` package with the `bedrock` extras
576-
(e.g., `pip install anthropic[bedrock]`).
575+
`ChatBedrockAnthropic`, requires the `anthropic` package with the `bedrock` extras:
576+
`pip install "chatlas[bedrock-anthropic]"`
577577
:::
578578
579579
Examples

chatlas/_github.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def ChatGithub(
4343
::: {.callout-note}
4444
## Python requirements
4545
46-
`ChatGithub` requires the `openai` package (e.g., `pip install openai`).
46+
`ChatGithub` requires the `openai` package: `pip install "chatlas[github]"`.
4747
:::
4848
4949

chatlas/_google.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ def ChatGoogle(
6161
::: {.callout-note}
6262
## Python requirements
6363
64-
`ChatGoogle` requires the `google-genai` package
65-
(e.g., `pip install google-genai`).
64+
`ChatGoogle` requires the `google-genai` package: `pip install "chatlas[google]"`.
6665
:::
6766
6867
Examples
@@ -530,8 +529,7 @@ def ChatVertex(
530529
::: {.callout-note}
531530
## Python requirements
532531
533-
`ChatGoogle` requires the `google-genai` package
534-
(e.g., `pip install google-genai`).
532+
`ChatGoogle` requires the `google-genai` package: `pip install "chatlas[vertex]"`.
535533
:::
536534
537535
::: {.callout-note}

chatlas/_groq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def ChatGroq(
4141
::: {.callout-note}
4242
## Python requirements
4343
44-
`ChatGroq` requires the `openai` package (e.g., `pip install openai`).
44+
`ChatGroq` requires the `openai` package: `pip install "chatlas[groq]"`.
4545
:::
4646
4747
Examples

chatlas/_ollama.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def ChatOllama(
5151
::: {.callout-note}
5252
## Python requirements
5353
54-
`ChatOllama` requires the `openai` package (e.g., `pip install openai`).
54+
`ChatOllama` requires the `openai` package: `pip install "chatlas[ollama]"`.
5555
:::
5656
5757

chatlas/_openai.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def ChatOpenAI(
7979
::: {.callout-note}
8080
## Python requirements
8181
82-
`ChatOpenAI` requires the `openai` package (e.g., `pip install openai`).
82+
`ChatOpenAI` requires the `openai` package: `pip install "chatlas[openai]"`.
8383
:::
8484
8585
Examples
@@ -592,7 +592,8 @@ def ChatAzureOpenAI(
592592
::: {.callout-note}
593593
## Python requirements
594594
595-
`ChatAzureOpenAI` requires the `openai` package (e.g., `pip install openai`).
595+
`ChatAzureOpenAI` requires the `openai` package:
596+
`pip install "chatlas[azure-openai]"`.
596597
:::
597598
598599
Examples

chatlas/_perplexity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def ChatPerplexity(
4343
::: {.callout-note}
4444
## Python requirements
4545
46-
`ChatPerplexity` requires the `openai` package (e.g., `pip install openai`).
46+
`ChatPerplexity` requires the `openai` package: `pip install "chatlas[perplexity]"`.
4747
:::
4848
4949

chatlas/_snowflake.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def ChatSnowflake(
5151
::: {.callout-note}
5252
## Python requirements
5353
54-
`ChatSnowflake`, requires the `snowflake-ml-python` package
55-
(e.g., `pip install snowflake-ml-python`).
54+
`ChatSnowflake`, requires the `snowflake-ml-python` package:
55+
`pip install "chatlas[snowflake]"`.
5656
:::
5757
5858
::: {.callout-note}

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ docs = [
6767
"sentence-transformers",
6868
"numpy",
6969
]
70+
# Provider extras ----
71+
anthropic = ["anthropic"]
72+
bedrock-anthropic = ["anthropic[bedrock]"]
73+
github = ["openai"]
74+
google = ["google-genai"]
75+
groq = ["openai"]
76+
ollama = ["openai"]
77+
openai = ["openai"]
78+
azure-openai = ["openai"]
79+
perplexity = ["openai"]
80+
snowflake = ["snowflake-ml-python"]
81+
vertex = ["google-genai"]
7082

7183
[tool.uv]
7284
dev-dependencies = [

0 commit comments

Comments
 (0)