Skip to content

Commit

Permalink
expanded documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
brainlid committed Jan 23, 2025
1 parent 33067ef commit 1ed79b1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/chains/llm_chain.ex
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,21 @@ defmodule LangChain.Chains.LLMChain do
replaced before running against the configured LLM. This is helpful, for
example, when a different system prompt is needed for Anthropic vs OpenAI.
## Mode Examples
**Use Case**: A chat with an LLM where functions are available to the LLM:
LLMChain.run(chain, mode: :while_needs_response)
This will execute any LLM called functions, returning the result to the LLM,
and giving it a chance to respond to the results.
**Use Case**: An application that exposes a function to the LLM, but we want
to stop once the function is successfully executed. When errors are
encountered, the LLM should be given error feedback and allowed to try again.
LLMChain.run(chain, mode: :until_success)
"""
@spec run(t(), Keyword.t()) :: {:ok, t()} | {:error, t(), LangChainError.t()}
def run(chain, opts \\ [])
Expand Down

0 comments on commit 1ed79b1

Please sign in to comment.