From 3ab3b447d7dd779dae0b4e0ce4d9a83d866fb6f8 Mon Sep 17 00:00:00 2001 From: BeatlesCoder Date: Tue, 11 Jul 2023 20:51:03 +0800 Subject: [PATCH] custom BASE_PATH --- Runtime/OpenAIApi.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Runtime/OpenAIApi.cs b/Runtime/OpenAIApi.cs index 2c4b0f6..5c2f439 100644 --- a/Runtime/OpenAIApi.cs +++ b/Runtime/OpenAIApi.cs @@ -36,14 +36,18 @@ private Configuration Configuration } /// OpenAI API base path for requests. - private const string BASE_PATH = "https://api.openai.com/v1"; + private string BASE_PATH = "https://api.openai.com/v1"; - public OpenAIApi(string apiKey = null, string organization = null) + public OpenAIApi(string apiKey = null, string organization = null, string customPath = null) { if (apiKey != null) { configuration = new Configuration(apiKey, organization); } + if(customPath != null) + { + BASE_PATH = customPath; + } } /// Used for serializing and deserializing PascalCase request object fields into snake_case format for JSON. Ignores null fields when creating JSON strings.