Skip to content

Commit ffcfb27

Browse files
authored
fixed Sarvam Integration and Typos (Fixes #19931) (#19932)
* fixed Sarvam Integration and Typos * final Typo Fixed * fixed the project.toml * fixed a missing comma
1 parent 2407e5d commit ffcfb27

File tree

6 files changed

+32
-29
lines changed

6 files changed

+32
-29
lines changed
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# LlamaIndex Llms Integration: Servam
1+
# LlamaIndex Llms Integration: Sarvam
22

3-
This is the Servam integration for LlamaIndex. Visit [Servam](https://docs.sarvam.ai/api-reference-docs/chat/completions) for information on how to get an API key and which models are supported.
3+
This is the Sarvam integration for LlamaIndex. Visit [Sarvam](https://docs.sarvam.ai/api-reference-docs/chat/completions) for information on how to get an API key and which models are supported.
44

55
## Installation
66

77
```bash
8-
pip install llama-index-llms-servam
8+
pip install llama-index-llms-sarvam
99
```
1010

1111
## Usage
1212

1313
```python
14-
from llama_index.llms.servam import Servam
14+
from llama_index.llms.sarvam import Sarvam
1515

16-
llm = Servam(model="servam-m", api_key="your-api-key")
16+
llm = Sarvam(model="sarvam-m", api_key="your-api-key")
1717
```
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from llama_index.llms.sarvam.base import Sarvam
2+
3+
__all__ = ["Sarvam"]

llama-index-integrations/llms/llama-index-llms-sarvam/llama_index/llms/servam/base.py renamed to llama-index-integrations/llms/llama-index-llms-sarvam/llama_index/llms/sarvam/base.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,39 @@
1111
from llama_index.llms.openai_like import OpenAILike
1212

1313
DEFAULT_API_BASE = "https://api.sarvam.ai/v1"
14-
DEFAULT_MODEL = "servam-m"
14+
DEFAULT_MODEL = "sarvam-m"
1515

1616

17-
class Servam(OpenAILike):
17+
class Sarvam(OpenAILike):
1818
"""
19-
Servam LLM.
19+
Sarvam LLM.
2020
21-
To instantiate the `Servam` class, you will need to provide an API key. You can set the API key either as an environment variable `SERVAM_API_KEY` or directly in the class
21+
To instantiate the `Sarvam` class, you will need to provide an API key. You can set the API key either as an environment variable `SARVAM_API_KEY` or directly in the class
2222
constructor. If setting it in the class constructor, it would look like this:
2323
24-
If you haven't signed up for an API key yet, you can do so on the Servam website at (https://servam.ai). Once you have your API key, you can use the `Servam` class to interact
24+
If you haven't signed up for an API key yet, you can do so on the Sarvam website at (https://sarvam.ai). Once you have your API key, you can use the `Sarvam` class to interact
2525
with the LLM for tasks like chatting, streaming, and completing prompts.
2626
2727
Examples:
28-
`pip install llama-index-llms-servam`
28+
`pip install llama-index-llms-sarvam`
2929
3030
```python
31-
from llama_index.llms.servam import Servam
31+
from llama_index.llms.sarvam import Sarvam
3232
33-
llm = Servam(
33+
llm = Sarvam(
3434
api_key="<your-api-key>",
3535
max_tokens=256,
3636
context_window=4096,
37-
model="servam-m",
37+
model="sarvam-m",
3838
)
3939
4040
response = llm.complete("Hello World!")
41-
print(str(response))
41+
print(response)
4242
```
4343
4444
"""
4545

46-
model: str = Field(description="The Servam model to use.")
46+
model: str = Field(description="The Sarvam model to use.")
4747
context_window: int = Field(
4848
default=DEFAULT_CONTEXT_WINDOW,
4949
description="The maximum number of context tokens for the model.",
@@ -67,8 +67,8 @@ def __init__(
6767
) -> None:
6868
additional_kwargs = additional_kwargs or {}
6969

70-
api_base = get_from_param_or_env("api_base", api_base, "SERVAM_API_BASE")
71-
api_key = get_from_param_or_env("api_key", api_key, "SERVAM_API_KEY")
70+
api_base = get_from_param_or_env("api_base", api_base, "SARVAM_API_BASE")
71+
api_key = get_from_param_or_env("api_key", api_key, "SARVAM_API_KEY")
7272

7373
super().__init__(
7474
model=model,
@@ -83,4 +83,4 @@ def __init__(
8383

8484
@classmethod
8585
def class_name(cls) -> str:
86-
return "Servam_LLM"
86+
return "Sarvam_LLM"

llama-index-integrations/llms/llama-index-llms-sarvam/llama_index/llms/servam/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

llama-index-integrations/llms/llama-index-llms-sarvam/pyproject.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ dev = [
2525
]
2626

2727
[project]
28-
name = "llama-index-llms-servam"
28+
name = "llama-index-llms-sarvam"
2929
version = "0.2.1"
30-
description = "llama-index llms servam integration"
31-
authors = [{name = "Yash Parmar", email = "[email protected]"}]
30+
description = "llama-index llms sarvam integration"
31+
authors = [
32+
{name = "Yash Parmar", email = "[email protected]"},
33+
{name = "Advik sharma", email = "[email protected]"},
34+
]
3235
requires-python = ">=3.9,<4.0"
3336
readme = "README.md"
3437
license = "MIT"
@@ -49,10 +52,10 @@ exclude = ["**/BUILD"]
4952

5053
[tool.llamahub]
5154
contains_example = false
52-
import_path = "llama_index.llms.servam"
55+
import_path = "llama_index.llms.sarvam"
5356

5457
[tool.llamahub.class_authors]
55-
Servam = "yash-parmar"
58+
Sarvam = ["yash-parmar", "advik-sharma"]
5659

5760
[tool.mypy]
5861
disallow_untyped_defs = true
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from llama_index.core.base.llms.base import BaseLLM
2-
from llama_index.llms.servam import Servam
2+
from llama_index.llms.sarvam import Sarvam
33

44

55
def test_llm_class():
6-
names_of_base_classes = [b.__name__ for b in Servam.__mro__]
6+
names_of_base_classes = [b.__name__ for b in Sarvam.__mro__]
77
assert BaseLLM.__name__ in names_of_base_classes

0 commit comments

Comments
 (0)