microsoft / microsoft/PowerPlatformConnectors

[BUG] AzureOpenAIService gives error on Get Completions

Open
#3,696 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
1.3k
Forks
1.5k
Avg merge
5d 15h
Merged PRs (30d)
11

Description

Type of Connector

Custom Connector

Name of Connector

AzureOpenAIService

Describe the bug

The AzureOpenAIService connector gives the same error on both the Dev branch and the Master branch, using both Get Completions and Get Chat Completions.

The error is:
BadRequest. Http request failed: the content was not a valid JSON. Error while parsing JSON: 'Unexpected character encountered while parsing value: U. Path '', line 0, position 0.'

Here are the raw inputs for the call (the JSON error isn't in here)
{ "host": { "connectionReferenceName": "shared_azureopenaiservice-5fc74f43d271e81e40-5ffe705c20f15fa55a", "operationId": "CreateCompletion" }, "parameters": { "deployment-id": "gpt-4o", "api-version": "2022-12-01", "body/prompt": "How are you?", "body/initial_scope": "You are a helpful assistant", "body/max_tokens": 100, "body/temperature": 0.2, "body/top_p": 1, "body/n": 1, "body/echo": false, "body/presence_penalty": 0, "body/frequency_penalty": 0, "body/best_of": 1 } }

I've looked through the code, but cannot figure out what may be causing this error

I've validated that my setup is correct, because the actions "Get Models" and "Get Deployments" work and return the information I expect from the AzureOpenAI service I have running in my Azure environment.

Is this a security bug?

No, this is not a security bug

What is the severity of this bug?

Severity 1 - Connector is broken or there's a very serious issue

To Reproduce

Use the Get Completions or Get Chat Completions actions

Expected behavior

The actions would work and return the results from the service

Environment summary

Power Automate Custom Connector - I used the "Add from GitHub" feature

Additional context

NA

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in custom-connectors/AzureOpenAIService and compare the CreateCompletion and Get Chat Completions definitions with the working Get Models and Get Deployments actions. Reproduce the request using the provided parameters and determine why the completion actions receive content that cannot be parsed as JSON. Done means both completion actions return valid results from the Azure OpenAI service.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
api, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.