Skip to main content

哪位大佬对大模型调用比较熟悉啊,求问

  1. 哪位大佬对大模型调用比较熟悉啊,求问。

    https://www.xfyun.cn/doc/spark/HTTP%E8%B0%83%E7%94%A8%E6%96%87%E6%A1%A3.html#_3-%E8%AF%B7%E6%B1%82%E8%AF%B4%E6%98%8E

    讯飞的这个大模型调用,官方的调用示例如下:
    "messages": [
        {
            "role": "system",
            "content": "你是知识渊博的助理"
        },
        {
            "role": "user",
            "content": "你好,讯飞星火"
        }
    ]
    

    如果我用它进行翻译 写法 1:
    "messages": [
        {
            "role": "user",
            "content": f"请将以下英文翻译成中文:\n\n{english_text}"
        }
    ]
    

    写法 2 ( AI 给出):
     {
      "role": "system",
      "content": "You are a professional translator. Translate English to Chinese accurately, naturally, and maintain the original tone and context."
     },
     {
      "role": "user",
      "content": f"请将以下英文翻译成中文:\n\n{english_text}"
     }
    

    疑问的一个点在于,这个 role 为 system 的作用在哪?写法 1 和写法 2 翻译结果差不多,官方文档示例写了两个角色反而增加了困惑,有没有必要加这个 role:system 。

    via V2EX - 技术 (author: biuyixia)
👀 open eyes to see the world. 丨 site views: -