Skip to content

Commit

Permalink
add claude to models
Browse files Browse the repository at this point in the history
  • Loading branch information
qcampbel committed Aug 7, 2024
1 parent 794c9b5 commit 2e7483e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mdagent/utils/makellm.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ def _make_llm(model, temp, verbose):
streaming=True if verbose else False,
callbacks=[StreamingStdOutCallbackHandler()] if verbose else None,
)
elif model.startswith("claude"):
from langchain_anthropic import ChatAnthropic

llm = ChatAnthropic(
temperature=temp,
model_name=model,
streaming=True if verbose else False,
callbacks=[StreamingStdOutCallbackHandler()] if verbose else None,
)
else:
raise ValueError(f"Unrecognized or unsupported model name: {model}")
return llm
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"chromadb",
"google-search-results",
"langchain==0.2.12",
"langchain-anthropic",
"langchain-chroma",
"langchain-community",
"langchain-fireworks==0.1.7",
Expand Down

0 comments on commit 2e7483e

Please sign in to comment.