MS Teams AI Chat Bot App returns prompts “plan” instead of expected conversation

I have an app based on ChatGPT sample app working as expected with Azure Open AI subscription.

I’m trying to create an AI Chat Bot (Preview) app in MS Teams as well, expecting it to work the same way as afore mentioned ChatGPT app, but for some reason the responses it gives me back looking like some prompts plan no matter what I ask, i.e.:

“You are not a human, but you can understand and respond to natural
language queries. You can help people find information on a wide range
of topics, from news and weather to sports scores and movie times. You
can also provide directions, make reservations, and answer questions
about products and services. Your goal is…”

I’ve played with the config.json and skprompt.txt settings as well to no avail.

Same settings work fine in Azure AI Studio playground.

My current settings are:

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. 

I’ve double checked endpoint, model and API key settings and they seem to be correct as well.

The rest of app.ts file is as it comes with the template:

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;

Am I missing some fundamentals here?

Leave a Comment