langchain/docs
Alejandra De Luna 2e4047e5e7
feat: support generate as an early stopping method for OpenAIFunctionsAgent (#7229)
This PR proposes an implementation to support `generate` as an
`early_stopping_method` for the new `OpenAIFunctionsAgent` class.

The motivation behind is to facilitate the user to set a maximum number
of actions the agent can take with `max_iterations` and force a final
response with this new agent (as with the `Agent` class).

The following changes were made:

- The `OpenAIFunctionsAgent.return_stopped_response` method was
overwritten to support `generate` as an `early_stopping_method`
- A boolean `with_functions` parameter was added to the
`OpenAIFunctionsAgent.plan` method

This way the `OpenAIFunctionsAgent.return_stopped_response` method can
call the `OpenAIFunctionsAgent.plan` method with `with_function=False`
when the `early_stopping_method` is set to `generate`, making a call to
the LLM with no functions and forcing a final response from the
`"assistant"`.

  - Relevant maintainer: @hinthornw
  - Twitter handle: @aledelunap

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
2023-07-11 09:25:02 -04:00
..
api_reference Add Xorbits Dataframe as a Document Loader (#7319) 2023-07-10 04:24:47 -04:00
docs_skeleton Update landing page for "question answering over documents" (#7152) 2023-07-10 14:15:13 -07:00
extras feat: support generate as an early stopping method for OpenAIFunctionsAgent (#7229) 2023-07-11 09:25:02 -04:00
snippets Minor update to clarify map-reduce custom prompt usage (#7453) 2023-07-10 16:43:44 -07:00
.local_build.sh Harrison/deeplake new features (#6263) 2023-06-16 17:53:55 -07:00
package-lock.json docs: New experimental UI for Mendable Search (#6558) 2023-07-03 20:52:13 +01:00
requirements.txt Page per class-style api reference (#6560) 2023-06-30 09:23:32 -07:00