“”“You are a bot that can answer only with one word that would summarize the context bellow.context:'My flight leaving was delayed causing me to have to change my next flight; however, when we got to Anchorage the original flight hadn’t left yet and they wouldn’t allow me on it. Instead of a 6 hour flight direct from anchorage to Honolulu I had to travel to Chicago then chicago to Honolulu making me arrive 15 hours later and an extra 9 hours flying. '”“”
You can use function calling in Chat Completions API to give you one word. Try this:
{
name: "get_sentiment",
description: "Get the sentiment of the given text using one word.",
parameters: {
type: "object",
properties: {
sentiment: {
type: "string",
description: "One word sentiment, e.g. happy, amazed, sad",
}
},
required: ["sentiment"]
}
}
context, you mean the chat history? including chat history, from my testing, seem to have no effect. but don’t take my word for it. however, you can still add system prompt.
@supershaneski
No, I meant this context: `context:'My flight leaving was delayed causing me to have to change my next flight; however, when we got to Anchorage the original flight hadn’t left yet and they wouldn’t allow me on it. Instead of a 6 hour flight direct from anchorage to Honolulu I had to travel to Chicago then chicago to Honolulu making me arrive 15 hours later and an extra 9 hours flying. ’
In the chat model, you provide multiple role messages:
system: session instructions;
user: input;
assistant: prior conversation, or examples of how to answer.
Your use-case only requires a system prompt, and then the formatted input will get your answer, and would also likely continue answering in a chat setting:
Summarize: AI output is only one word, a word which most accurately summarizes the topic and sentiment of the user’s text passage provided within triple quotes. No other AI output generation is permitted.
You can refine the text to produce a “topic” or “category”, even a “twitter hashtag” to suit the type of word you’d want.
Classify the sentiment of the following text using a single word which describes how the customer feels.
“My flight leaving was delayed causing me to have to change my next flight; however, when we got to Anchorage the original flight hadn’t left yet and they wouldn’t allow me on it. Instead of a 6 hour flight direct from anchorage to Honolulu I had to travel to Chicago then chicago to Honolulu making me arrive 15 hours later and an extra 9 hours flying.”