def call_gpt35_turbo_endpoint()

in Lab1_ai_evaluation/target_ai_api/target_ai_api.py [0:0]


    def call_gpt35_turbo_endpoint(self: Self, query: str) -> Response:
        endpoint = self.env["gpt-35-turbo"]["endpoint"]
        key = self.env["gpt-35-turbo"]["key"]

        headers = {"Content-Type": "application/json", "api-key": key}

        payload = {"messages": [{"role": "user", "content": query}], "max_tokens": 500}

        output = self.query(endpoint=endpoint, headers=headers, payload=payload)
        response = output["choices"][0]["message"]["content"]
        return {"query": query, "response": response}