Skip to content

Feature request: Stop sequence support #44

Open
@jacoblee93

Description

@jacoblee93

It would be nice in certain situations to be able to pass a list of stop sequences as input:

For example, see: https://platform.openai.com/docs/api-reference/chat/create#chat-create-stop

When the model would generate a sequence like this, it would instead stop and return the current generation to the user. This more easily allows for more advanced prompting techniques like LangChain's original text-based ReAct agent loop, where we want the model to not generate an Observation: and instead have it populated by an external tool call.

We can get around this by streaming a generation and cancelling the request when we detect a stop sequence in the accumulated output, but this is a bit less nice.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ecosystem parityA feature that other popular language model APIs offerenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions