Skip to content

Instantly share code, notes, and snippets.

@Vesnica
Created November 28, 2023 09:11
Show Gist options
  • Save Vesnica/8c533ac3ca83a06b654dcbe4d721830c to your computer and use it in GitHub Desktop.
Save Vesnica/8c533ac3ca83a06b654dcbe4d721830c to your computer and use it in GitHub Desktop.
Semantic Kernel Proxy Setting
  • Official tutorial won't work if you behind a corp proxy
  • Add the following code to fix:
    import openai
    
    openai.proxy = "http://IP:PORT"
    
  • Additionally, you can set api key like:
    openai.api_key_path = "path/to/the/key"
    
  • And use it like:
    kernel.add_chat_service("chat-gpt", OpenAIChatCompletion("gpt-4-1106-preview", openai.api_key))
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment