Forest Admin - API reference
    Preparing search index...

    Class LangChainAdapter

    Handles generic format conversions between OpenAI and LangChain.

    Index
    • Convert OpenAI tool_choice to LangChain format.

      Parameters

      • toolChoice: ChatCompletionToolChoiceOption

      Returns LangChainToolChoice

    • Replace tool call arguments that are not valid JSON, so the provider's SDK accepts the history. A relayed invalid tool call leaves them there, and the next turn must still go through.

      Type Parameters

      • T

      Parameters

      • messages: T[]

      Returns T[]