MCPcopy
hub / github.com/SqueezeAILab/LLMCompiler / predict

Method predict

src/chains/llm_chain.py:290–305  ·  view source on GitHub ↗

Format prompt with kwargs and pass to LLM. Args: callbacks: Callbacks to pass to LLMChain **kwargs: Keys to pass to prompt template. Returns: Completion from LLM. Example: .. code-block:: python completion =

(self, callbacks: Callbacks = None, **kwargs: Any)

Source from the content-addressed store, hash-verified

288 return self.create_outputs(response)[0]
289
290 def predict(self, callbacks: Callbacks = None, **kwargs: Any) -> str:
291 """Format prompt with kwargs and pass to LLM.
292
293 Args:
294 callbacks: Callbacks to pass to LLMChain
295 **kwargs: Keys to pass to prompt template.
296
297 Returns:
298 Completion from LLM.
299
300 Example:
301 .. code-block:: python
302
303 completion = llm.predict(adjective="funny")
304 """
305 return self(kwargs, callbacks=callbacks)[self.output_key]
306
307 async def apredict(self, callbacks: Callbacks = None, **kwargs: Any) -> str:
308 """Format prompt with kwargs and pass to LLM.

Callers 4

predict_and_parseMethod · 0.95
_callMethod · 0.80
planMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected