mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-23 07:09:31 +00:00
Community : Modified doc strings and example notebook for Clarifai (#15816)
Community : Modified doc strings and example notebook for Clarifai Description: 1. Modified doc strings inside clarifai vectorstore class and embeddings. 2. Modified notebook examples. --------- Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
This commit is contained in:
parent
97411e998f
commit
9e1ed17bfb
@ -127,10 +127,8 @@
|
||||
"Setup the user id and app id where the model resides. You can find a list of public models on https://clarifai.com/explore/models\n",
|
||||
"\n",
|
||||
"You will have to also initialize the model id and if needed, the model version id. Some models have many versions, you can choose the one appropriate for your task.\n",
|
||||
"\n",
|
||||
" or\n",
|
||||
" \n",
|
||||
"You can use the model_url (for ex: \"https://clarifai.com/anthropic/completion/models/claude-v2\") for intialization."
|
||||
" \n",
|
||||
"Alternatively, You can use the model_url (for ex: \"https://clarifai.com/anthropic/completion/models/claude-v2\") for intialization."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -50,20 +50,12 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"execution_count": null,
|
||||
"id": "3f5dc9d7-65e3-4b5b-9086-3327d016cfe0",
|
||||
"metadata": {
|
||||
"tags": []
|
||||
},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
" ········\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# Please login and get your API key from https://clarifai.com/settings/security\n",
|
||||
"from getpass import getpass\n",
|
||||
|
@ -23,7 +23,8 @@ class ClarifaiEmbeddings(BaseModel, Embeddings):
|
||||
app_id=APP_ID,
|
||||
model_id=MODEL_ID)
|
||||
(or)
|
||||
clarifai_llm = Clarifai(model_url=EXAMPLE_URL)
|
||||
Example_URL = "https://clarifai.com/clarifai/main/models/BAAI-bge-base-en-v15"
|
||||
clarifai = ClarifaiEmbeddings(model_url=EXAMPLE_URL)
|
||||
"""
|
||||
|
||||
model_url: Optional[str] = None
|
||||
|
@ -24,10 +24,12 @@ class Clarifai(VectorStore):
|
||||
.. code-block:: python
|
||||
|
||||
from langchain_community.vectorstores import Clarifai
|
||||
from langchain_community.embeddings.openai import OpenAIEmbeddings
|
||||
|
||||
embeddings = OpenAIEmbeddings()
|
||||
vectorstore = Clarifai("langchain_store", embeddings.embed_query)
|
||||
clarifai_vector_db = Clarifai(
|
||||
user_id=USER_ID,
|
||||
app_id=APP_ID,
|
||||
number_of_docs=NUMBER_OF_DOCS,
|
||||
)
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
|
Loading…
Reference in New Issue
Block a user