Skip to content
This repository was archived by the owner on May 10, 2024. It is now read-only.

Commit d5ce1ad

Browse files
authored
Merge pull request #202 from amikos-tech/feature/improve-example-readability-imports
[DOCS]: Improved example readability
2 parents fe8b0f6 + 05f6f67 commit d5ce1ad

File tree

7 files changed

+9
-3
lines changed

7 files changed

+9
-3
lines changed

docs/embeddings/cohere.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Chroma also provides a convenient wrapper around Cohere's embedding API. This em
2121
This embedding function relies on the `cohere` python package, which you can install with `pip install cohere`.
2222

2323
```python
24+
import chromadb.utils.embedding_functions as embedding_functions
2425
cohere_ef = embedding_functions.CohereEmbeddingFunction(api_key="YOUR_API_KEY", model_name="large")
2526
cohere_ef(texts=["document1","document2"])
2627
```

docs/embeddings/google-gemini.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ This embedding function relies on the `google-generativeai` python package, whic
2424

2525
```python
2626
# import
27-
import chromadb
28-
from chromadb.utils import embedding_functions
27+
import chromadb.utils.embedding_functions as embedding_functions
2928

3029
# use directly
3130
google_ef = embedding_functions.GoogleGenerativeAiEmbeddingFunction(api_key="YOUR_API_KEY")

docs/embeddings/google-palm.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
To use the PaLM embedding API, you must have `google.generativeai` Python package installed and have the API key. To use:
99

1010
```python
11+
import chromadb.utils.embedding_functions as embedding_functions
1112
palm_embedding = embedding_functions.GooglePalmEmbeddingFunction(
1213
api_key=api_key, model=model_name)
1314

docs/embeddings/hugging-face.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Chroma also provides a convenient wrapper around HuggingFace's embedding API. Th
2121
This embedding function relies on the `requests` python package, which you can install with `pip install requests`.
2222

2323
```python
24+
import chromadb.utils.embedding_functions as embedding_functions
2425
huggingface_ef = embedding_functions.HuggingFaceEmbeddingFunction(
2526
api_key="YOUR_API_KEY",
2627
model_name="sentence-transformers/all-MiniLM-L6-v2"

docs/embeddings/instructor.md

+2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ There are three models available. The default is `hkunlp/instructor-base`, and f
99

1010
```python
1111
#uses base model and cpu
12+
import chromadb.utils.embedding_functions as embedding_functions
1213
ef = embedding_functions.InstructorEmbeddingFunction()
1314
```
1415
or
1516
```python
17+
import chromadb.utils.embedding_functions as embedding_functions
1618
ef = embedding_functions.InstructorEmbeddingFunction(
1719
model_name="hkunlp/instructor-xl", device="cuda")
1820
```

docs/embeddings/jinaai.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Chroma provides a convenient wrapper around JinaAI's embedding API. This embeddi
2121
This embedding function relies on the `requests` python package, which you can install with `pip install requests`.
2222

2323
```python
24+
import chromadb.utils.embedding_functions as embedding_functions
2425
jinaai_ef = embedding_functions.JinaEmbeddingFunction(
2526
api_key="YOUR_API_KEY",
2627
model_name="jina-embeddings-v2-base-en"

docs/embeddings/openai.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Chroma provides a convenient wrapper around OpenAI's embedding API. This embeddi
2121
This embedding function relies on the `openai` python package, which you can install with `pip install openai`.
2222

2323
```python
24-
import chromadb.utils.embedding_functions
24+
import chromadb.utils.embedding_functions as embedding_functions
2525
openai_ef = embedding_functions.OpenAIEmbeddingFunction(
2626
api_key="YOUR_API_KEY",
2727
model_name="text-embedding-ada-002"
@@ -30,6 +30,7 @@ openai_ef = embedding_functions.OpenAIEmbeddingFunction(
3030

3131
To use the OpenAI embedding models on other platforms such as Azure, you can use the `api_base` and `api_type` parameters:
3232
```python
33+
import chromadb.utils.embedding_functions as embedding_functions
3334
openai_ef = embedding_functions.OpenAIEmbeddingFunction(
3435
api_key="YOUR_API_KEY",
3536
api_base="YOUR_API_BASE_PATH",

0 commit comments

Comments
 (0)