MCPcopy
hub / github.com/langchain-ai/langchain / partial

Method partial

libs/core/langchain_core/prompts/base.py:181–188  ·  view source on GitHub ↗

Return a partial of the prompt template.

(self, **kwargs: Union[str, Callable[[], str]])

Source from the content-addressed store, hash-verified

179 return self.format_prompt(**kwargs)
180
181 def partial(self, **kwargs: Union[str, Callable[[], str]]) -> BasePromptTemplate:
182 """Return a partial of the prompt template."""
183 prompt_dict = self.__dict__.copy()
184 prompt_dict["input_variables"] = list(
185 set(self.input_variables).difference(kwargs)
186 )
187 prompt_dict["partial_variables"] = {**self.partial_variables, **kwargs}
188 return type(self)(**prompt_dict)
189
190 def _merge_partial_and_user_variables(self, **kwargs: Any) -> Dict[str, Any]:
191 # Get partial params:

Callers 15

agent.pyFile · 0.45
chain.pyFile · 0.45
agent.pyFile · 0.45
retriever_agent.pyFile · 0.45
agent.pyFile · 0.45
runnable_chat_lambdaFunction · 0.45
test_partialFunction · 0.45
test_partialFunction · 0.45
mainFunction · 0.45

Calls 2

listFunction · 0.85
copyMethod · 0.45