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

Method invoke

libs/core/langchain_core/tools.py:253–269  ·  view source on GitHub ↗
(
        self,
        input: Union[str, Dict],
        config: Optional[RunnableConfig] = None,
        **kwargs: Any,
    )

Source from the content-addressed store, hash-verified

251 return create_schema_from_function(self.name, self._run)
252
253 def invoke(
254 self,
255 input: Union[str, Dict],
256 config: Optional[RunnableConfig] = None,
257 **kwargs: Any,
258 ) -> Any:
259 config = ensure_config(config)
260 return self.run(
261 input,
262 callbacks=config.get("callbacks"),
263 tags=config.get("tags"),
264 metadata=config.get("metadata"),
265 run_name=config.get("run_name"),
266 run_id=config.pop("run_id", None),
267 config=config,
268 **kwargs,
269 )
270
271 async def ainvoke(
272 self,

Callers 15

get_toolsFunction · 0.45
evaluate_runMethod · 0.45
image_summarizeFunction · 0.45
main.pyFile · 0.45
main.pyFile · 0.45
image_summarizeFunction · 0.45
main.pyFile · 0.45
main.pyFile · 0.45
ingest.pyFile · 0.45
main.pyFile · 0.45
main.pyFile · 0.45
chain.pyFile · 0.45

Calls 4

runMethod · 0.95
ensure_configFunction · 0.90
popMethod · 0.80
getMethod · 0.45

Tested by 15

test_invokeMethod · 0.36
test_conversationMethod · 0.36
test_usage_metadataMethod · 0.36
test_stop_sequenceMethod · 0.36
test_tool_callingMethod · 0.36
test_image_inputsMethod · 0.36
test_anthropic_inputsMethod · 0.36
test_invokeFunction · 0.36