What is the purpose of the "role information" parameter in Azure OpenAI On Your Data?
I am wondering about the purpose of the role information
parameter in the Azure OpenAI On Your Data call. How does it differ from the system prompt? If it is provided to Azure AI Search, how is it involved in the retrieval process, given that retrieval itself does not use an LLM?
Azure OpenAI Service
-
Manas Mohanty (Quadrant Resource LLC) • 215 Reputation points • Microsoft Vendor
2025-01-30T07:27:03.23+00:00 Hi Hadjmbarek Nadia!
Welcome to Azure OpenAI Q and A forum, thank you for posting your query here.
Role information params are part of chat_prompt . It is sent to Azure OpenAI agents for generating responses.
1. The role information parameter in the Azure OpenAI on Your Data call specifies the role or context of the user interacting with the model*. This parameter helps the model understand the user's permissions, responsibilities, and specific context in which they are operating. Essentially, it provides additional context that can influence the model's behavior and ensure that the responses are tailored to the user's role.
{ "role": "user", #role information of user "content": "User role: analyst, how to find do Exploratory data analysis, Context: Data analysis" }
2. On the other hand, the system prompt is a predefined set of instructions or context provided to the model before it starts generating responses. The system prompt sets the overall behavior, tone, and objectives of the model's interactions. It acts as a guiding framework for how the model should respond in a given situation.
1{ "role": "system", #system prompt "content": "You are an AI assistant that helps people find information." }, 2. { "role": "system", #system prompt "content": "You are a customer service assistant for an e-commerce company. Your role is to help customers with their inquiries, provide product information, assist with orders, and handle any issues they may encounter. Always be polite, professional, and helpful. If you encounter a question you can't answer, kindly suggest the user contact support at support@ecommerce.com." }
An example sample code would look like below.
chat_prompt = [ { "role": "system", "content": "You are an AI assistant that helps people find information." }, { "role": "user", "content": "User role: analyst, How to find do Exploratory data analysis, Context: Data analysis" } ] # Include speech result if speech is enabled messages = chat_prompt # Generate the completion completion = client.chat.completions.create( model=deployment, messages=messages, max_tokens=800, temperature=0.7, top_p=0.95, frequency_penalty=0, presence_penalty=0, stop=None, stream=False )
On the context of AI Search, Role information details will impact on the relevance/restriction of answers which is being pulled from Azure AI search indexes.
Kindly refer below
Thank you.
-
Hadjmbarek Nadia • 45 Reputation points
2025-01-30T09:11:41.1766667+00:00 Hello,
Thanks for your answer. I am actually referring to the parameter
role information
in the data sources parameter for Azure OpenAI on Your Data:"data_sources": [{ "type": "azure_search", "parameters": { "endpoint": self.config.search_endpoint, "index_name": self.config.search_index, "semantic_configuration": f"{self.config.search_index}-semantic-configuration", "query_type": "vector_semantic_hybrid", "in_scope": True, "role_information": "HERE", "strictness": x, "top_n_documents": y, "authentication": { "type": "api_key", "key": self.config.search_key }, "embedding_dependency": { "type": "deployment_name", "deployment_name": "z" } } }] }
-
Manas Mohanty (Quadrant Resource LLC) • 215 Reputation points • Microsoft Vendor
2025-01-30T10:37:16.0033333+00:00 Thank you for clarifying your query.
As per below documentation, "It gives the model instructions about how it should behave and any context it should reference when generating a response. You can describe the assistant's personality and tell it how to format responses." Yes, usage is very similar to system_prompt from OpenAI.
It impacts the relevance of answer which is normally pulled from AI search index.
Thank you.
-
Hadjmbarek Nadia • 45 Reputation points
2025-01-30T10:41:46.5166667+00:00 Thanks @Manas Mohanty (Quadrant Resource LLC) ! But do you know how does it differ from the system prompt, given that it also tells the model how it should behave when generating a response?
-
Hadjmbarek Nadia • 45 Reputation points
2025-01-30T10:43:44.19+00:00 Thanks @Manas Mohanty (Quadrant Resource LLC) ! But do you know how does it differ from the system prompt, given that it also tells the model how it should behave when generating a response?
-
Manas Mohanty (Quadrant Resource LLC) • 215 Reputation points • Microsoft Vendor
2025-01-31T07:05:36.31+00:00 The only difference visible is System prompt is maneuvered/filtered from OpenAI agent side (when there is not add your own data scenario) while role_information is maneuvered from both Azure OpenAI and AI search side (with add your own data scenario).
It is filtering data based on the context provided on OpenAI and AI search.
Thank you.
-
Manas Mohanty (Quadrant Resource LLC) • 215 Reputation points • Microsoft Vendor
2025-02-03T04:26:20.8233333+00:00
Sign in to comment