-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
46 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,43 @@ | ||
using System.Text.Json.Serialization; | ||
using OpenAI; | ||
|
||
namespace LangChain.Serve.OpenAI; | ||
|
||
public class ServeController( | ||
ServeOptions options) | ||
{ | ||
public ModelsList GetModel() | ||
{ | ||
return new ModelsList | ||
{ | ||
Models = options.ListModels().Select(static x => new Model12 | ||
{ | ||
Object = ModelObject.Model, | ||
Created = DateTimeOffset.UtcNow, | ||
Id = x, | ||
OwnedBy = "OpenAI", | ||
}).ToList() | ||
}; | ||
} | ||
|
||
public ModelsList ListModels() | ||
{ | ||
return new ModelsList | ||
{ | ||
Models = options.ListModels().Select(static x => new Model12 | ||
{ | ||
Object = ModelObject.Model, | ||
Created = DateTimeOffset.UtcNow, | ||
Id = x, | ||
OwnedBy = "OpenAI", | ||
}).ToList() | ||
}; | ||
} | ||
} | ||
|
||
public sealed class ModelsList | ||
{ | ||
[JsonInclude] | ||
[JsonPropertyName("data")] | ||
public IReadOnlyCollection<Model12> Models { get; set; } = []; | ||
} | ||
// using System.Text.Json.Serialization; | ||
// using OpenAI; | ||
// | ||
// namespace LangChain.Serve.OpenAI; | ||
// | ||
// public class ServeController( | ||
// ServeOptions options) | ||
// { | ||
// public ModelsList GetModel() | ||
// { | ||
// return new ModelsList | ||
// { | ||
// Models = options.ListModels().Select(static x => new Model12 | ||
// { | ||
// Object = ModelObject.Model, | ||
// Created = DateTimeOffset.UtcNow, | ||
// Id = x, | ||
// OwnedBy = "OpenAI", | ||
// }).ToList() | ||
// }; | ||
// } | ||
// | ||
// public ModelsList ListModels() | ||
// { | ||
// return new ModelsList | ||
// { | ||
// Models = options.ListModels().Select(static x => new Model12 | ||
// { | ||
// Object = ModelObject.Model, | ||
// Created = DateTimeOffset.UtcNow, | ||
// Id = x, | ||
// OwnedBy = "OpenAI", | ||
// }).ToList() | ||
// }; | ||
// } | ||
// } | ||
// | ||
// public sealed class ModelsList | ||
// { | ||
// [JsonInclude] | ||
// [JsonPropertyName("data")] | ||
// public IReadOnlyCollection<Model15> Models { get; set; } = []; | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters