• 大模型连接器客户端Api

    Parameters

    • name: string

      连接器名字

    • llmType: string

      大模型类型

    Returns LLMClient

    Example


    import * as llm from 'llm';

    let client = llm.newClient(instanceName, llmType);
    let message = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Hello!"},
    {"role": "assistant", "content": "Hello! How can I assist you today "}
    ];
    let resp = client.chat(message, {
    "temperature": 0.8,
    "top_p": 1.0,
    "presence_penalty": 0.0
    });

    Tips

    大模型类型范围如下:

    大模型 llmType取值
    DeepSeek deepseek
    通义千问 qwen
    MaaS云平台 maas
    盘古 pangu
    混元 hunyuan
    豆包 doubao
    文心一言 qianfan
    ChatGLM glm
    Kimi kimi
    Ollama ollama
    Xinference xinference
    自定义大模型 custom_llm