Skip to content

Commit

Permalink
use block scoped namespaces in solution
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson committed Nov 15, 2023
1 parent 60bf212 commit d0b6f81
Show file tree
Hide file tree
Showing 13 changed files with 572 additions and 560 deletions.
113 changes: 57 additions & 56 deletions OpenAI-DotNet/Assistants/Assistant.cs
Original file line number Diff line number Diff line change
@@ -1,70 +1,71 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenAI.Assistants;

public sealed class Assistant
namespace OpenAI.Assistants
{
/// <summary>
/// The identifier, which can be referenced in API endpoints.
/// </summary>
[JsonPropertyName("id")]
public string Id { get; set; }
public sealed class Assistant
{
/// <summary>
/// The identifier, which can be referenced in API endpoints.
/// </summary>
[JsonPropertyName("id")]
public string Id { get; set; }

/// <summary>
/// The object type, which is always assistant.
/// </summary>
[JsonPropertyName("object")]
public string Object { get; set; } = "assistant";
/// <summary>
/// The object type, which is always assistant.
/// </summary>
[JsonPropertyName("object")]
public string Object { get; set; } = "assistant";

/// <summary>
/// The Unix timestamp (in seconds) for when the assistant was created.
/// </summary>
[JsonPropertyName("created_at")]
public int CreatedAt { get; set; }
/// <summary>
/// The Unix timestamp (in seconds) for when the assistant was created.
/// </summary>
[JsonPropertyName("created_at")]
public int CreatedAt { get; set; }

/// <summary>
/// The name of the assistant. The maximum length is 256 characters.
/// </summary>
[JsonPropertyName("name")]
public string Name { get; set; }
/// <summary>
/// The name of the assistant. The maximum length is 256 characters.
/// </summary>
[JsonPropertyName("name")]
public string Name { get; set; }

/// <summary>
/// The description of the assistant. The maximum length is 512 characters.
/// </summary>
[JsonPropertyName("description")]
public string Description { get; set; }
/// <summary>
/// The description of the assistant. The maximum length is 512 characters.
/// </summary>
[JsonPropertyName("description")]
public string Description { get; set; }

/// <summary>
/// ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.
/// </summary>
[JsonPropertyName("model")]
public string Model { get; set; }
/// <summary>
/// ID of the model to use. You can use the List models API to see all of your available models, or see our Model overview for descriptions of them.
/// </summary>
[JsonPropertyName("model")]
public string Model { get; set; }

/// <summary>
/// The system instructions that the assistant uses. The maximum length is 32768 characters.
/// </summary>
[JsonPropertyName("instructions")]
public string Instructions { get; set; }
/// <summary>
/// The system instructions that the assistant uses. The maximum length is 32768 characters.
/// </summary>
[JsonPropertyName("instructions")]
public string Instructions { get; set; }

/// <summary>
/// A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant.
/// Tools can be of types code_interpreter, retrieval, or function.
/// </summary>
[JsonPropertyName("tools")]
public IReadOnlyList<AssistantTool> Tools { get; set; }
/// <summary>
/// A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant.
/// Tools can be of types code_interpreter, retrieval, or function.
/// </summary>
[JsonPropertyName("tools")]
public IReadOnlyList<AssistantTool> Tools { get; set; }

/// <summary>
/// A list of file IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant.
/// Files are ordered by their creation date in ascending order.
/// </summary>
[JsonPropertyName("file_ids")]
public IReadOnlyList<string> FileIds { get; set; }
/// <summary>
/// A list of file IDs attached to this assistant. There can be a maximum of 20 files attached to the assistant.
/// Files are ordered by their creation date in ascending order.
/// </summary>
[JsonPropertyName("file_ids")]
public IReadOnlyList<string> FileIds { get; set; }

/// <summary>
/// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information
/// about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
/// </summary>
[JsonPropertyName("metadata")]
public IReadOnlyDictionary<string, object> Metadata { get; set; }
/// <summary>
/// Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information
/// about the object in a structured format. Keys can be a maximum of 64 characters long and values can be a maxium of 512 characters long.
/// </summary>
[JsonPropertyName("metadata")]
public IReadOnlyDictionary<string, object> Metadata { get; set; }
}
}
51 changes: 26 additions & 25 deletions OpenAI-DotNet/Assistants/AssistantFile.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
using System.Text.Json.Serialization;

namespace OpenAI.Assistants;

/// <summary>
/// File attached to an assistant.
/// </summary>
public sealed class AssistantFile
namespace OpenAI.Assistants
{
/// <summary>
/// The identifier, which can be referenced in API endpoints.
/// File attached to an assistant.
/// </summary>
[JsonPropertyName("id")]
public string Id { get; set; }
public sealed class AssistantFile
{
/// <summary>
/// The identifier, which can be referenced in API endpoints.
/// </summary>
[JsonPropertyName("id")]
public string Id { get; set; }

/// <summary>
/// The object type, which is always assistant.file.
/// </summary>
[JsonPropertyName("object")]
public string Object { get; set; } = "assistant.file";
/// <summary>
/// The object type, which is always assistant.file.
/// </summary>
[JsonPropertyName("object")]
public string Object { get; set; } = "assistant.file";

/// <summary>
/// The Unix timestamp (in seconds) for when the assistant file was created.
/// </summary>
[JsonPropertyName("created_at")]
public int CreatedAt { get; set; }
/// <summary>
/// The Unix timestamp (in seconds) for when the assistant file was created.
/// </summary>
[JsonPropertyName("created_at")]
public int CreatedAt { get; set; }

/// <summary>
/// The assistant ID that the file is attached to.
/// </summary>
/// <returns></returns>
[JsonPropertyName("assistant_id")]
public string AssistantId { get; set; }
/// <summary>
/// The assistant ID that the file is attached to.
/// </summary>
/// <returns></returns>
[JsonPropertyName("assistant_id")]
public string AssistantId { get; set; }
}
}
27 changes: 14 additions & 13 deletions OpenAI-DotNet/Assistants/AssistantFilesList.cs
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace OpenAI.Assistants;

public class AssistantFilesList
namespace OpenAI.Assistants
{
[JsonPropertyName("object")]
public string Object { get; set; } = "list";
public class AssistantFilesList
{
[JsonPropertyName("object")]
public string Object { get; set; } = "list";

[JsonPropertyName("data")]
public IReadOnlyList<AssistantFile> Data { get; set; }
[JsonPropertyName("data")]
public IReadOnlyList<AssistantFile> Data { get; set; }

[JsonPropertyName("first_id")]
public string FirstId { get; set; }
[JsonPropertyName("first_id")]
public string FirstId { get; set; }

[JsonPropertyName("last_id")]
public string LastId { get; set; }
[JsonPropertyName("last_id")]
public string LastId { get; set; }

[JsonPropertyName("has_more")]
public bool HasMore { get; set; }
[JsonPropertyName("has_more")]
public bool HasMore { get; set; }
}
}
15 changes: 8 additions & 7 deletions OpenAI-DotNet/Assistants/AssistantTool.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
using System.Text.Json.Serialization;
using OpenAI.Chat;

namespace OpenAI.Assistants;

public sealed class AssistantTool
namespace OpenAI.Assistants
{
[JsonPropertyName("type")]
public string Type { get; set; }
public sealed class AssistantTool
{
[JsonPropertyName("type")]
public string Type { get; set; }

[JsonPropertyName("function")]
public Function Function { get; set; }
[JsonPropertyName("function")]
public Function Function { get; set; }
}
}
Loading

0 comments on commit d0b6f81

Please sign in to comment.