Agent skill

llm-integration

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/llm-integration-skill

SKILL.md

LLM Integration SKILL

Provider Abstraction

python
from langchain_openai import ChatOpenAI
from langchain_anthropic import ChatAnthropic

llm = ChatOpenAI(model="gpt-4")
# or
llm = ChatAnthropic(model="claude-3-sonnet-20240229")

Fallback Chain

python
from langchain.chat_models import init_chat_model

llm = init_chat_model(
    "gpt-4",
    fallbacks=["claude-3-sonnet-20240229", "ollama/llama2"]
)

Streaming

python
for chunk in llm.stream("What is RAG?"):
    print(chunk.content, end="", flush=True)

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results