hiexam
microsoft · AI-102 · Q295 · code_completion · azure_openai, code_snippet

Complete the code snippet to select the correct parameters for creating an OpenAI completion and data source integratio…

Complete the code snippet to select the correct parameters for creating an OpenAI completion and data source integration in Azure.
completion = openai.{{slot1}}.create(
  messages=[{"role": "user", "content": "What are the differences between Azure Machine Learning and Azure AI services?"}],
  deployment_id=os.environ.get("AOAIDeploymentId"),
  dataSources=[
    {
      "type": "{{slot2}}",
      "parameters": {
        "endpoint": os.environ.get("SearchEndpoint"),
        "key": os.environ.get("SearchKey"),
        "indexName": os.environ.get("SearchIndex")
      }
    }
  ]
)
Correct slot values

Answer hidden

Unlock AI-102

First 5 questions of every exam are free. Unlock the rest.

Includes
  • · All — questions
  • · Verified answers + AI explanations
  • · Spaced-repetition mistake notebook
  • · Phone, tablet, laptop sync

One-time payment. Doesn't auto-renew. · Already paid? Sign in