File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -49,9 +49,8 @@ class Completions {
4949
5050 async create (
5151 _arg1 : PezzoCreateChatCompletionRequest | OpenAIChatCompletionCreateParams ,
52- optionsOrPezzoProps :
53- | Parameters < OpenAI [ "chat" ] [ "completions" ] [ "create" ] > [ 1 ]
54- | PezzoProps = { }
52+ pezzoOptions : PezzoProps = { } ,
53+ openaiOptions ?: Parameters < OpenAI [ "chat" ] [ "completions" ] [ "create" ] > [ 1 ]
5554 ) : Promise < OpenAI . Chat . ChatCompletion > {
5655 const arg1 = _arg1 as PezzoCreateChatCompletionRequest ;
5756
@@ -78,16 +77,6 @@ class Completions {
7877 ...nativeOptions ,
7978 } ;
8079
81- let pezzoOptions : PezzoProps | undefined ;
82-
83- if (
84- "variables" in optionsOrPezzoProps ||
85- "properties" in optionsOrPezzoProps ||
86- "cache" in optionsOrPezzoProps
87- ) {
88- pezzoOptions = optionsOrPezzoProps as PezzoProps ;
89- }
90-
9180 if ( pezzoOptions ?. variables ) {
9281 const messages = interpolateVariablesRecursively <
9382 OpenAI . Chat . CompletionCreateParams [ "messages" ]
@@ -155,11 +144,7 @@ class Completions {
155144 {
156145 ...( requestBody as OpenAI . Chat . CompletionCreateParamsNonStreaming ) ,
157146 } ,
158- "variables" in optionsOrPezzoProps
159- ? undefined
160- : ( optionsOrPezzoProps as Parameters <
161- OpenAI [ "chat" ] [ "completions" ] [ "create" ]
162- > [ 1 ] )
147+ openaiOptions
163148 ) ;
164149
165150 reportPayload = {
You can’t perform that action at this time.
0 commit comments