Skip to content

Commit 982d239

Browse files
committed
fb
1 parent 5f2db73 commit 982d239

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

codegen/generator/src/Visitors/MetadataQueryParamVisitor.cs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,12 @@
1212
namespace OpenAILibraryPlugin.Visitors;
1313

1414
/// <summary>
15-
/// This visitor modifies GetRawPagesAsync methods to consider HasMore in addition to LastId when deciding whether to continue pagination.
16-
/// It also replaces specific parameters with an options type for pagination methods.
15+
/// This visitor fixes up usage of the metadata query parameter into the proper format.
1716
/// </summary>
1817
public class MetadataQueryParamVisitor : ScmLibraryVisitor
1918
{
2019

2120
private static readonly string[] _chatParamsToReplace = ["after", "before", "limit", "order", "model", "metadata"];
22-
private static readonly Dictionary<string, string> _paramReplacementMap = new()
23-
{
24-
{ "after", "AfterId" },
25-
{ "before", "LastId" },
26-
{ "limit", "PageSizeLimit" },
27-
{ "order", "Order" },
28-
{ "model", "Model" },
29-
{ "metadata", "Metadata" }
30-
};
31-
private static readonly Dictionary<string, (string ReturnType, string OptionsType, string[] ParamsToReplace)> _optionsReplacements = new()
32-
{
33-
{
34-
"GetChatCompletions",
35-
("ChatCompletion", "ChatCompletionCollectionOptions", _chatParamsToReplace)
36-
},
37-
{
38-
"GetChatCompletionsAsync",
39-
("ChatCompletion", "ChatCompletionCollectionOptions", _chatParamsToReplace)
40-
}
41-
};
4221

4322
/// <summary>
4423
/// Visits Create*Request methods to modify how metadata query parameters are handled.

0 commit comments

Comments
 (0)