How to call azure openai API on own data with python?

Parth Bhavsar 20 Reputation points
2023-09-12T05:05:31.35+00:00

i want to call the azure openai API from python and get the chat working on my own data which is fetched from the index from the cognitive search of azure

problem is i am able to get the expected answer on the webapp generated from the openai console but not getting the same response in the API call from python or REST call

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
1,014 questions
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,080 questions
{count} votes

Accepted answer
  1. ajkuma 26,136 Reputation points Microsoft Employee
    2023-09-15T04:24:37.29+00:00

    @Parth Bhavsar ,

    Following-up, just to clarify, are receiving an error response or is it just the quality of the result isn't as good?

     

    A good reference is the Python code that generates the HTTP request for the webapp: https://github.com/microsoft/sample-app-aoai-chatGPT/blob/main/app.py#L162   - You may compare that with your code to understand any discrepancy.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.