I’m resurfacing a question with more concrete examples, trying to understand:
- why system message seems to not work as expected
- strategy for providing instructions in “on your data” case
For example, calling POST https://{service-name}.openai.azure.com/openai/deployments/{model-name}/extensions/chat/completions?api-version=2023-08-01-preview
{
"messages": [
{
"role": "system",
"content": "Your task is to always respond in French."
},
{
"role": "user",
"content": "How to cherry pick a PR?"
}
],
"temperature": 0.5,
"max_tokens": 12000,
"top_p": 1,
"dataSources": [
{
"type": "AzureCognitiveSearch",
"parameters": {
...
"queryType": "semantic",
"inScope": true,
"roleInformation": "Your task is to always respond in French."
}
}
]
}
I get the following response:
{
"id": "GUID",
"model": "gpt-4-32k",
"created": timestamp,
"object": "extensions.chat.completion",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "The most common way to cherry pick your PR ...",
"end_turn": true,
"context": {
"messages": [
{
"role": "tool",
"content": "{\"citations\": [{\"content\": \"{citation_content}\", \"intent\": \"How to cherry pick a PR?\"}",
"end_turn": false
}
]
}
}
}
]
}
- as we can see, system message had no effect. Is this a known issue?
Example providing instructions in user’s prompt, main problem is that search query used in Azure Search contains parts of that prompt.
POST https://{service-name}.openai.azure.com/openai/deployments/{model-name}/extensions/chat/completions?api-version=2023-08-01-preview
{
"messages": [
{
"role": "user",
"content": "How to cherry pick a PR? When responding to this query, please translate the message to French."
}
],
"temperature": 0.5,
"max_tokens": 12000,
"top_p": 1,
"dataSources": [
{
"type": "AzureCognitiveSearch",
"parameters": {
...
"queryType": "semantic",
"inScope": true,
"roleInformation": "Your task is to always respond in French."
}
}
]
}
I get the following response:
{
"id": "GUID",
"model": "gpt-4-32k",
"created": timestamp,
"object": "extensions.chat.completion",
"choices": [
{
"index": 0,
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": "Voici comment vous pouvez choisir un PR ...",
"end_turn": true,
"context": {
"messages": [
{
"role": "tool",
"content": "{\"citations\": [{\"content\": \"This is the most common way ....\", \"intent\": \"How to cherry pick a PR? When responding to this query, please translate the message to French.\"}",
"end_turn": false
}
]
}
}
}
]
}
- prompt instruction directly on user’s prompt worked, but the search query contains the prompt (as you can see
intent, that’s the field used to search in search service) .
Two main questions:
- how to use the system message? I’ve tried different approaches (like using the
roleInformationindataSourcesor moving the system message after the user prompt) but none seems to work. Is this a known issue? - how can I provide instructions to the model. Maybe I want to respond with a summary or I want to respond in a specific way on each iteration. How can I provide that kind of instruction if that instruction will be included in the search query? I’m sure there’s a better strategy here.