Skip to content

Instantly share code, notes, and snippets.

View larkintuckerllc's full-sized avatar

John Tucker larkintuckerllc

View GitHub Profile
import asyncio
from langchain.agents import create_agent
from langchain.messages import HumanMessage
from langchain_mcp_adapters.client import MultiServerMCPClient
QUESTION = HumanMessage(content="What's the weather in San Francisco?")
client = MultiServerMCPClient(
{
from langchain.agents import create_agent
from langgraph.checkpoint.memory import InMemorySaver
from langchain.messages import HumanMessage
from langchain.tools import tool
from tavily import TavilyClient
tavily_client = TavilyClient();
CONFIG = {"configurable": {"thread_id": "1"}}
QUESTION = HumanMessage(content="I have some leftover chicken and rice in my fridge. What can I make?")
from langchain.agents import create_agent
from langgraph.checkpoint.memory import InMemorySaver
from langchain.messages import HumanMessage
from langchain.tools import tool
CONFIG = {"configurable": {"thread_id": "1"}}
QUESTION_1 = HumanMessage(content="Hello my name is Sean and my favorite color is green.")
QUESTION_2 = HumanMessage(content="What is my favorite color?")
agent = create_agent(
from langchain.agents import create_agent
from langchain.messages import HumanMessage
from langchain.tools import tool
from tavily import TavilyClient
tavily_client = TavilyClient();
QUESTION = HumanMessage(content="Who is the current mayor of San Francisco?")
@tool
from langchain.agents import create_agent
from langchain.messages import HumanMessage
from langchain.tools import tool
QUESTION = HumanMessage(content="What's the square root of 467?")
SYSTEM_PROMPT = "You are an arithmetic wizard."
@tool
def square_root(x: float) -> float:
"""
from langchain.agents import create_agent
from langchain.messages import HumanMessage
from pydantic import BaseModel
QUESTION = HumanMessage(content="What's the capital of the Moon?")
SYSTEM_PROMPT = "You are a science fiction writer, create a capital city at the users request."
class CapitalCity(BaseModel):
name: str
location: str
from langchain.agents import create_agent
from langchain.messages import HumanMessage
SYSTEM_PROMPT = """"
You are a science fiction writer, create a capital city at the users request.
User: What is the capital of Mars?
Agent: Marsialias
User: What is the capital of Venus?
from langchain.agents import create_agent
from langchain.messages import HumanMessage
agent = create_agent(model="gpt-5-nano")
response = agent.invoke({
"messages": [HumanMessage(content="What's the capital of the Moon?")],
})
print(response["messages"][-1].content)
from pprint import pprint
from langchain.chat_models import init_chat_model
def main():
model = init_chat_model(model="gpt-5-nano")
response = model.invoke("What's the capital of the Moon?")
print(response.content)
pprint(response.response_metadata)
package com.example;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import io.grpc.StatusRuntimeException;
public class GreeterClient {
public static void main(String[] args) {
String host = "localhost";
int port = 50051;