-
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
{ | ||
"name": "OpenAI.Editor" | ||
} | ||
"name": "OpenAI.Editor", | ||
"references": [ | ||
"GUID:3248779d86bd31747b5d2214f30b01ac" | ||
], | ||
"includePlatforms": [ | ||
"Editor" | ||
], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [], | ||
"versionDefines": [], | ||
"noEngineReferences": false | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using System.IO; | ||
using UnityEditor; | ||
|
||
namespace OpenAI.Editor | ||
{ | ||
[CustomEditor(typeof(OpenAIConfigurationSettings))] | ||
internal class OpenAIConfigurationSettingsInspector : UnityEditor.Editor | ||
{ | ||
private void OnEnable() | ||
{ | ||
var update = false; | ||
var currentPath = AssetDatabase.GetAssetPath(target); | ||
|
||
if (string.IsNullOrWhiteSpace(currentPath)) | ||
{ | ||
return; | ||
} | ||
|
||
if (!Directory.Exists("Assets/Resources")) | ||
{ | ||
Directory.CreateDirectory("Assets/Resources"); | ||
update = true; | ||
} | ||
|
||
if (!currentPath.Contains("Resources")) | ||
{ | ||
File.Move(Path.GetFullPath(currentPath), Path.GetFullPath($"Assets/Resources/{target.name}.asset")); | ||
File.Move(Path.GetFullPath($"{currentPath}.meta"), Path.GetFullPath($"Assets/Resources/{target.name}.asset.meta")); | ||
update = true; | ||
} | ||
|
||
if (update) | ||
{ | ||
EditorApplication.delayCall += () => | ||
{ | ||
AssetDatabase.Refresh(ImportAssetOptions.ForceUpdate); | ||
EditorGUIUtility.PingObject(target); | ||
}; | ||
} | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using System.Runtime.CompilerServices; | ||
using UnityEngine.Scripting; | ||
|
||
[assembly: Preserve] | ||
[assembly: AlwaysLinkAssembly] | ||
[assembly: InternalsVisibleTo("OpenAI.Editor")] | ||
[assembly: InternalsVisibleTo("OpenAI.Tests")] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
namespace OpenAI | ||
{ | ||
public abstract class BaseEndPoint | ||
{ | ||
protected readonly OpenAIClient Api; | ||
|
||
/// <summary> | ||
/// Constructor of the api endpoint. | ||
/// Rather than instantiating this yourself, access it through an instance of <see cref="OpenAIClient"/>. | ||
/// </summary> | ||
internal BaseEndPoint(OpenAIClient api) => Api = api; | ||
|
||
/// <summary> | ||
/// Gets the basic endpoint url for the API | ||
/// </summary> | ||
/// <param name="engine">Optional, Engine to use for endpoint.</param> | ||
/// <returns>The completed basic url for the endpoint.</returns> | ||
protected abstract string GetEndpoint(Engine engine = null); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace OpenAI | ||
{ | ||
public abstract class BaseResponse | ||
{ | ||
/// <summary> | ||
/// The server-side processing time as reported by the API. This can be useful for debugging where a delay occurs. | ||
/// </summary> | ||
public TimeSpan ProcessingTime { get; internal set; } | ||
|
||
/// <summary> | ||
/// The organization associated with the API request, as reported by the API. | ||
/// </summary> | ||
public string Organization { get; internal set; } | ||
|
||
/// <summary> | ||
/// The request id of this API call, as reported in the response headers. This may be useful for troubleshooting or when contacting OpenAI support in reference to a specific request. | ||
/// </summary> | ||
public string RequestId { get; internal set; } | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.