Skip to content

Commit e7d6af5

Browse files
committed
#49 IMPLEMENT IModelsEndpoint
1 parent eec04af commit e7d6af5

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using System.Collections.Generic;
2+
using System.Threading.Tasks;
3+
4+
namespace OpenAI_API.Models
5+
{
6+
/// <summary>
7+
/// The API endpoint for querying available models
8+
/// </summary>
9+
public interface IModelsEndpoint
10+
{
11+
/// <summary>
12+
/// Get details about a particular Model from the API, specifically properties such as <see cref="Model.OwnedBy"/> and permissions.
13+
/// </summary>
14+
/// <param name="id">The id/name of the model to get more details about</param>
15+
/// <returns>Asynchronously returns the <see cref="Model"/> with all available properties</returns>
16+
Task<Model> RetrieveModelDetailsAsync(string id);
17+
18+
/// <summary>
19+
/// Get details about a particular Model from the API, specifically properties such as <see cref="Model.OwnedBy"/> and permissions.
20+
/// </summary>
21+
/// <param name="id">The id/name of the model to get more details about</param>
22+
/// <param name="auth">Obsolete: IGNORED</param>
23+
/// <returns>Asynchronously returns the <see cref="Model"/> with all available properties</returns>
24+
Task<Model> RetrieveModelDetailsAsync(string id, APIAuthentication auth = null);
25+
26+
/// <summary>
27+
/// List all models via the API
28+
/// </summary>
29+
/// <returns>Asynchronously returns the list of all <see cref="Model"/>s</returns>
30+
Task<List<Model>> GetModelsAsync();
31+
}
32+
}

OpenAI_API/Model/ModelsEndpoint.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace OpenAI_API.Models
88
/// <summary>
99
/// The API endpoint for querying available models
1010
/// </summary>
11-
public class ModelsEndpoint : EndpointBase
11+
public class ModelsEndpoint : EndpointBase, IModelsEndpoint
1212
{
1313
/// <summary>
1414
/// The name of the endpoint, which is the final path segment in the API URL. For example, "models".

0 commit comments

Comments
 (0)