openai/openai-dotnet

Public

mirrored from https://github.com/openai/openai-dotnetAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
83db8ef208eccfa6eeff4aaa710be7330936f083

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

OpenAI.Responses/src/Custom/CreateResponseOptions.cs

126lines · modecode

1using Microsoft.TypeSpec.Generator.Customizations;
2using System.Collections.Generic;
3using System.Linq;
4
5namespace OpenAI.Responses;
6
7// CUSTOM: Renamed.
8[CodeGenType("CreateResponse")]
9public partial class CreateResponseOptions
10{
11 // CUSTOM: Added as a convenience.
12 public CreateResponseOptions(string model, IEnumerable<ResponseItem> inputItems) : this()
13 {
14 Argument.AssertNotNullOrEmpty(model, nameof(model));
15 Argument.AssertNotNull(inputItems, nameof(inputItems));
16
17 Model = model;
18 InputItems = inputItems.ToList();
19 }
20
21 // CUSTOM: Renamed.
22 /// <summary>
23 /// Gets or sets whether to run the response in background mode. This corresponds to the "background" property in the JSON representation.
24 /// </summary>
25 [CodeGenMember("Background")]
26 public bool? BackgroundModeEnabled { get; set; }
27
28 // CUSTOM: Changed type.
29 /// <summary>
30 /// Gets or sets how tool calls should be selected during response generation. This corresponds to the "tool_choice" property in the JSON representation.
31 /// </summary>
32 [CodeGenMember("ToolChoice")]
33 public ResponseToolChoice ToolChoice { get; set; }
34
35 // CUSTOM: Renamed.
36 /// <summary>
37 /// Gets or sets the input items to be processed for the response. This corresponds to the "input" property in the JSON representation.
38 /// </summary>
39 [CodeGenMember("Input")]
40 public IList<ResponseItem> InputItems { get; }
41
42 // CUSTOM: Renamed.
43 /// <summary>
44 /// Gets or sets the list of fields to include in the response. This corresponds to the "include" property in the JSON representation.
45 /// </summary>
46 [CodeGenMember("Include")]
47 public IList<IncludedResponseProperty> IncludedProperties { get; }
48
49 // CUSTOM: Renamed.
50 /// <summary>
51 /// Gets or sets whether multiple tool calls can be made in parallel. This corresponds to the "parallel_tool_calls" property in the JSON representation.
52 /// </summary>
53 [CodeGenMember("ParallelToolCalls")]
54 public bool? ParallelToolCallsEnabled { get; set; }
55
56 // CUSTOM: Renamed.
57 /// <summary>
58 /// Gets or sets whether the response should be stored for later retrieval. This corresponds to the "store" property in the JSON representation.
59 /// </summary>
60 [CodeGenMember("Store")]
61 public bool? StoredOutputEnabled { get; set; }
62
63 // CUSTOM: Renamed.
64 /// <summary>
65 /// Gets or sets whether the response should be streamed. This corresponds to the "stream" property in the JSON representation.
66 /// </summary>
67 [CodeGenMember("Stream")]
68 public bool? StreamingEnabled { get; set; }
69
70 // CUSTOM: Renamed.
71 /// <summary>
72 /// Gets or sets the maximum number of output tokens to generate. This corresponds to the "max_output_tokens" property in the JSON representation.
73 /// </summary>
74 [CodeGenMember("MaxOutputTokens")]
75 public int? MaxOutputTokenCount { get; set; }
76
77 // CUSTOM: Renamed.
78 /// <summary>
79 /// Gets or sets the maximum number of tool calls allowed during response generation. This corresponds to the "max_tool_calls" property in the JSON representation.
80 /// </summary>
81 [CodeGenMember("MaxToolCalls")]
82 public int? MaxToolCallCount { get; set; }
83
84 // CUSTOM: Renamed.
85 /// <summary>
86 /// Gets or sets the reasoning options for the response. This corresponds to the "reasoning" property in the JSON representation.
87 /// </summary>
88 [CodeGenMember("Reasoning")]
89 public ResponseReasoningOptions ReasoningOptions { get; set; }
90
91 // CUSTOM: Renamed.
92 /// <summary>
93 /// Gets or sets the text format options for the response. This corresponds to the "text" property in the JSON representation.
94 /// </summary>
95 [CodeGenMember("Text")]
96 public ResponseTextOptions TextOptions { get; set; }
97
98 // CUSTOM: Renamed.
99 /// <summary>
100 /// Gets or sets the conversation options for the response. This corresponds to the "conversation" property in the JSON representation.
101 /// </summary>
102 [CodeGenMember("Conversation")]
103 public ResponseConversationOptions ConversationOptions { get; set; }
104
105 /// <summary>
106 /// An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability.
107 /// This corresponds to the "top_logprobs" property in the JSON representation.
108 /// </summary>
109 [CodeGenMember("TopLogprobs")]
110 public int? TopLogProbabilityCount { get; set; }
111
112 // CUSTOM: Renamed.
113 /// <summary>
114 /// Gets or sets the truncation mode for the response. This corresponds to the "truncation" property in the JSON representation.
115 /// </summary>
116 [CodeGenMember("Truncation")]
117 public ResponseTruncationMode? TruncationMode { get; set; }
118
119 // CUSTOM: Renamed.
120 /// <summary>
121 /// Gets or sets the end user identifier. This corresponds to the "user" property in the JSON representation.
122 /// </summary>
123 [CodeGenMember("User")]
124 public string EndUserId { get; set; }
125
126}
127