Hierarchy

  • BaseChatIflytekXinghuo
    • ChatIflytekXinghuo

Constructors

Properties

ParsedCallOptions: Omit<BaseLanguageModelCallOptions, never>
apiUrl: string
caller: AsyncCaller

The async caller should be used by subclasses to make any async calls, which will thus benefit from the concurrency and retry logic.

domain: string
iflytekApiKey: string
iflytekApiSecret: string
iflytekAppid: string
max_tokens: number = 2048
streaming: boolean = false
temperature: number = 0.5
top_k: number = 4
verbose: boolean

Whether to print out response text.

version: string = "v2.1"
callbacks?: Callbacks
metadata?: Record<string, unknown>
tags?: string[]
userId?: string
lc_runnable: boolean = true

Accessors

Methods

  • Calls the Xinghuo API completion.

    Parameters

    • request: ChatCompletionRequest

      The request to send to the Xinghuo API.

    • stream: true
    • Optional signal: AbortSignal

      The signal for the API call.

    Returns Promise<IterableReadableStream<string>>

    The response from the Xinghuo API.

  • Parameters

    • request: ChatCompletionRequest
    • stream: false
    • Optional signal: AbortSignal

    Returns Promise<ChatCompletionResponse>

  • Generates a prompt based on the input prompt values.

    Parameters

    Returns Promise<LLMResult>

    A Promise that resolves to an LLMResult.

  • Get the identifying parameters for the model

    Returns {
        streaming: boolean;
        version: string;
        chat_id?: string;
        max_tokens?: number;
        temperature?: number;
        top_k?: number;
    }

    • streaming: boolean
    • version: string
    • Optional chat_id?: string
    • Optional max_tokens?: number
    • Optional temperature?: number
    • Optional top_k?: number
  • Get the parameters used to invoke the model

    Returns Omit<ChatCompletionRequest, "messages"> & {
        streaming: boolean;
    }

  • Type Parameters

    • WebSocketStream

    Parameters

    • options: WebSocketStreamOptions

    Returns Promise<WebSocketStream>

  • Predicts the next message based on a text input.

    Parameters

    • text: string

      The text input.

    • Optional options: string[] | BaseLanguageModelCallOptions

      The call options or an array of stop sequences.

    • Optional callbacks: Callbacks

      The callbacks for the language model.

    Returns Promise<string>

    A Promise that resolves to a string.

  • Predicts the next message based on the input messages.

    Parameters

    Returns Promise<BaseMessage>

    A Promise that resolves to a BaseMessage.

  • Stream all output from a runnable, as reported to the callback system. This includes all inner runs of LLMs, Retrievers, Tools, etc. Output is streamed as Log objects, which include a list of jsonpatch ops that describe how the state of the run has changed in each step, and the final state of the run. The jsonpatch ops can be applied in order to construct state.

    Parameters

    Returns AsyncGenerator<RunLogPatch, any, unknown>

  • Create a unique cache key for a specific call to a specific language model.

    Parameters

    Returns string

    A unique cache key.

  • Helper method to transform an Iterator of Input values into an Iterator of Output values, with callbacks. Use this to implement stream() or transform() in Runnable subclasses.

    Type Parameters

    Parameters

    • inputGenerator: AsyncGenerator<I, any, unknown>
    • transformer: ((generator, runManager?, options?) => AsyncGenerator<O, any, unknown>)
    • Optional options: BaseLanguageModelCallOptions & {
          runType?: string;
      }

    Returns AsyncGenerator<O, any, unknown>

Generated using TypeDoc