We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello guys i am new to python i am using prompty, can we add additional datasource in the prompty file Below is the example i can found on microsoft docs https://learn.microsoft.com/en-us/azure/ai-services/openai/references/azure-search?tabs=python#examples
import os from openai import AzureOpenAI from azure.identity import DefaultAzureCredential, get_bearer_token_provider endpoint = os.environ.get("AzureOpenAIEndpoint") deployment = os.environ.get("ChatCompletionsDeploymentName") search_endpoint = os.environ.get("SearchEndpoint") search_index = os.environ.get("SearchIndex") token_provider = get_bearer_token_provider(DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default") client = AzureOpenAI( azure_endpoint=endpoint, azure_ad_token_provider=token_provider, api_version="2024-02-01", ) completion = client.chat.completions.create( model=deployment, messages=[ { "role": "user", "content": "Who is DRI?", }, ], extra_body={ "data_sources": [ { "type": "azure_search", "parameters": { "endpoint": search_endpoint, "index_name": search_index, "authentication": { "type": "system_assigned_managed_identity" } } } ] } ) print(completion.model_dump_json(indent=2))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello guys i am new to python i am using prompty, can we add additional datasource in the prompty file
Below is the example i can found on microsoft docs
https://learn.microsoft.com/en-us/azure/ai-services/openai/references/azure-search?tabs=python#examples
The text was updated successfully, but these errors were encountered: