need client to connect my server #345
Unanswered
Tarun Kukreja (grimo8805)
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
`
import os
from langchain_openai import ChatOpenAI
from langchain.prompts import PromptTemplate
from dotenv import load_dotenv
load_dotenv(override=True)
from mcp.server.fastmcp import FastMCP
carosel_mcp = FastMCP("API_Server")
GPT_MODEL = os.getenv("GPT_MODEL")
CAROUSEL GENERATION
@carosel_mcp.tool()
async def create_carousel(text: str, tone_level: int, user_prompt: str, trace = None) -> str:
print("INFO: Creating carousel...")
#create langchain handler from trace
handler = None
if trace is not None:
handler=trace.get_langchain_handler()
if name == "main":
carosel_mcp.run(transport="streamable-http")
`
above is my server code , was facing issue while creating client for this , want langgraph agent to commnunicate with the abover server with transport protocol as streamable http, Thanks :)
Beta Was this translation helpful? Give feedback.
All reactions