Skip to content

Commit

Permalink
add private deployment on langchain (#277)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmer1 authored Dec 10, 2024
1 parent c26016b commit 279af9b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fern/pages/integrations/cohere-and-langchain/chat-on-langchain.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,14 @@ llm = ChatCohere(cohere_api_key="COHERE_API_KEY",
chain = load_summarize_chain(llm, chain_type="stuff")

chain.invoke({"input_documents": docs})
```

### Using LangChain on Private Deployments

You can use LangChain with privately deployed Cohere models. To use it, specify your model deployment URL in the `base_url` parameter.

```python PYTHON
llm = ChatCohere(base_url=<YOUR_DEPLOYMENT_URL>,
cohere_api_key="COHERE_API_KEY",
model="MODEL_NAME")
```
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,12 @@ embeddings = BedrockEmbeddings(

embeddings.embed_query("This is a content of the document")
```
### Using LangChain on Private Deployments

You can use LangChain with privately deployed Cohere models. To use it, specify your model deployment URL in the `base_url` parameter.

```python PYTHON
llm = CohereEmbeddings(base_url=<YOUR_DEPLOYMENT_URL>,
cohere_api_key="COHERE_API_KEY",
model="MODEL_NAME")
```
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,13 @@ citations = docs[-1].metadata['citations']
print("Citations:")
print(citations)
```

### Using LangChain on Private Deployments

You can use LangChain with privately deployed Cohere models. To use it, specify your model deployment URL in the `base_url` parameter.

```python PYTHON
llm = CohereRerank(base_url=<YOUR_DEPLOYMENT_URL>,
cohere_api_key="COHERE_API_KEY",
model="MODEL_NAME")
```

0 comments on commit 279af9b

Please sign in to comment.