Example

const model = new ChatIflytekXinghuo();
const response = await model.invoke([new HumanMessage("Nice to meet you!")]);
console.log(response);

Hierarchy

  • BaseChatIflytekXinghuo
    • ChatIflytekXinghuo

Constructors

Properties

apiUrl: string
domain: string
iflytekApiKey: string
iflytekApiSecret: string
iflytekAppid: string
max_tokens: number = 2048
streaming: boolean = false
temperature: number = 0.5
top_k: number = 4
version: string = "v2.1"
userId?: string

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>

  • 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;
    }

Generated using TypeDoc