semantic-kernel icon indicating copy to clipboard operation
semantic-kernel copied to clipboard

APIConnectionError

Open liguanghe opened this issue 1 year ago • 1 comments

python sk.py Error: (<ErrorCodes.ServiceError: 6>, 'OpenAI service failed to complete the prompt', APIConnectionError(message='Error communicating with OpenAI', http_status=None, request_id=None))

To Reproduce

  1. pip install semantic-kernel
  2. put '''OPENAI_API_KEY="my key" OPENAI_ORG_ID=" my id" ''' into .env
  3. copy sample to sk.py
  4. run sk .py
  5. show: Error: (<ErrorCodes.ServiceError: 6>, 'OpenAI service failed to complete the prompt', APIConnectionError(message='Error communicating with OpenAI', http_status=None, request_id=None))

Expected behavior i runed openai-api in a .py by cli and it worked. it seems not newwork problem.

Desktop (please complete the following information):

  • OS: MacOs
  • IDE: code
  • python3.11

liguanghe avatar May 15 '23 07:05 liguanghe

Have you solved the problem? I am having the same error.

JJDawn avatar May 16 '23 09:05 JJDawn

same problem

bingokunkun avatar May 30 '23 02:05 bingokunkun

same problem

tjulh avatar Jun 01 '23 06:06 tjulh

I got the same problem. I fixed my problem by adding a config setting in the source code. See my other comment for details. https://github.com/microsoft/semantic-kernel/issues/627#issuecomment-1573221317

chenlucu avatar Jun 02 '23 06:06 chenlucu

same problem

spewmeps avatar Jul 12 '23 06:07 spewmeps

I also have the same problem: Error: (<ErrorCodes.ServiceError: 6>, 'OpenAI service failed to complete the chat', APIConnectionError(message='Error communicating with OpenAI', http_status=None, request_id=None))

quangngoc avatar Jul 28 '23 15:07 quangngoc

@mkarle can you look into this?

nacharya1 avatar Aug 24 '23 22:08 nacharya1

This only started with Python3.10 and is due to proxy settings not being detected by semantic kernel when referencing openai. This fixed it: https://github.com/microsoft/semantic-kernel/issues/627#issuecomment-1578109735

GhimBoon avatar Aug 31 '23 02:08 GhimBoon

@liguanghe is this issue now fixed for you as well? cc: @mkarle

nacharya1 avatar Sep 06 '23 05:09 nacharya1

@liguanghe are you continuing to have an issue with this? Since there's been no activity on this issue in several months I am going to close it. Feel free to open it back up if you continue to have problems.

moonbox3 avatar Dec 13 '23 21:12 moonbox3