Skip to content

Commit

Permalink
com.openai.unity 7.0.5 (#143)
Browse files Browse the repository at this point in the history
- Fixed OpenAISettings configuration lookup
  • Loading branch information
StephenHodgson authored Dec 10, 2023
1 parent fd8918c commit a446783
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions Runtime/Authentication/OpenAISettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,22 @@ public OpenAISettings(OpenAIConfiguration configuration)
configuration = Resources.LoadAll<OpenAIConfiguration>(string.Empty).FirstOrDefault(asset => asset != null);
}

if (configuration == null)
if (configuration != null)
{
throw new MissingReferenceException($"Failed to find a valid {nameof(OpenAIConfiguration)}!");
}

if (configuration.UseAzureOpenAI)
{
Info = new OpenAISettingsInfo(configuration.ResourceName, configuration.DeploymentId, configuration.ApiVersion, configuration.UseAzureActiveDirectory);
cachedDefault = this;
if (configuration.UseAzureOpenAI)
{
Info = new OpenAISettingsInfo(configuration.ResourceName, configuration.DeploymentId, configuration.ApiVersion, configuration.UseAzureActiveDirectory);
cachedDefault = this;
}
else
{
Info = new OpenAISettingsInfo(domain: configuration.ProxyDomain, apiVersion: configuration.ApiVersion);
cachedDefault = this;
}
}
else
{
Info = new OpenAISettingsInfo(domain: configuration.ProxyDomain, apiVersion: configuration.ApiVersion);
Info = new OpenAISettingsInfo();
cachedDefault = this;
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "OpenAI",
"description": "A OpenAI package for the Unity Game Engine to use GPT-4, GPT-3.5, GPT-3 and Dall-E though their RESTful API (currently in beta).\n\nIndependently developed, this is not an official library and I am not affiliated with OpenAI.\n\nAn OpenAI API account is required.",
"keywords": [],
"version": "7.0.4",
"version": "7.0.5",
"unity": "2021.3",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.openai.unity#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.openai.unity/releases",
Expand Down

0 comments on commit a446783

Please sign in to comment.