MS Teams AI 聊天机器人应用程序返回提示“计划”而不是预期的对话

问题描述 投票:0回答:1

我有一个基于 ChatGPT 示例应用程序的应用程序,可以按预期与 Azure Open AI 订阅一起工作。

我也在尝试在 MS Teams 中创建一个 AI 聊天机器人(预览版)应用程序,期望它的工作方式与前面提到的 ChatGPT 应用程序相同,但由于某种原因,它给我的响应看起来像是一些提示计划没有不管我问什么,即:

“你不是人类,但你可以理解并回应自然 语言查询。您可以帮助人们查找广泛的信息 各种主题,从新闻和天气到体育比分和电影时间。你 还可以提供指导、预订并回答问题 关于产品和服务。你的目标是……”

我也尝试过

config.json
skprompt.txt
设置,但无济于事。

相同的设置在 Azure AI Studio 游乐场中运行良好。

我当前的设置是:

config.json

{
  "schema": 1,
  "description": "AI Bot",
  "type": "completion",
  "completion": {
    "max_tokens": 200,
    "temperature": 0.9,
    "top_p": 0.0,
    "presence_penalty": 0.6,
    "frequency_penalty": 0.0
  }
}

skprompt.txt

You are an AI assistant that helps people find information. 

我已经仔细检查了端点、模型和 API 密钥设置,它们似乎也是正确的。

app.ts
文件的其余部分与模板一起提供:

import { MemoryStorage } from "botbuilder";
import * as path from "path";

import {
  Application,
  AzureOpenAIPlanner,
  DefaultPromptManager,
  OpenAIPlanner,
  OpenAIModerator,
} from "@microsoft/teams-ai";

import config from "./config";

// Create AI components
const planner = new AzureOpenAIPlanner({
  apiKey: config.azureOpenAIKey,
  endpoint: config.azureOpenAIEndpoint,
  defaultModel: "gpt3_5-some-custom-model-001",
  useSystemMessage: true,
  logRequests: true, 
  apiVersion: "2023-07-01-preview"
});

const promptManager = new DefaultPromptManager(path.join(__dirname, "../src/prompts"));

// Define storage and application
const storage = new MemoryStorage();
const app = new Application({
  storage,
  ai: {
    planner,
    promptManager,
    prompt: "chat",
    history: {
      assistantHistoryType: "text",
    },
  },
});

app.conversationUpdate("membersAdded", async (context) => {
  await context.sendActivity("How can I help you today?");
});

export default app;

我在这里缺少一些基础知识吗?

microsoft-teams azure-openai
1个回答
0
投票

事实证明,由于某种原因,与 Teams Chef Bot 模板

index.ts
文件相比,AI 聊天机器人预览模板缺少大量代码。

因此,我只是简单地复制了缺失的部分(尽管无法让主持人工作),并且 AI 聊天机器人开始按预期在 MS Teams 中工作。

© www.soinside.com 2019 - 2024. All rights reserved.