MCPcopy Create free account
hub / github.com/LangGraph-GUI/LangGraph-GUI-backend / create_llm_chain

Function create_llm_chain

src/llm.py:73–82  ·  view source on GitHub ↗

Creates and invokes an LLM chain using the prompt template and the history.

(prompt_template: str, llm, history: str)

Source from the content-addressed store, hash-verified

71
72
73def create_llm_chain(prompt_template: str, llm, history: str) -> str:
74 """
75 Creates and invokes an LLM chain using the prompt template and the history.
76 """
77 prompt = PromptTemplate.from_template(prompt_template)
78 llm_chain = prompt | llm | StrOutputParser()
79 inputs = {"history": history}
80 generation = llm_chain.invoke(inputs)
81
82 return generation
83
84def create_llm_chain_google(prompt_template: str, llm, history: Optional[str] = None) -> str:
85 url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash:generateContent"

Callers 3

execute_stepFunction · 0.90
execute_toolFunction · 0.90
condition_switchFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected