File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -59,21 +59,21 @@ export interface ParsedChatCompletion<ParsedT> extends ChatCompletion {
59
59
export type ChatCompletionParseParams = ChatCompletionCreateParamsNonStreaming ;
60
60
61
61
export class Completions extends APIResource {
62
- async parse < Params extends ChatCompletionParseParams , ParsedT = ExtractParsedContentFromParams < Params > > (
62
+ parse < Params extends ChatCompletionParseParams , ParsedT = ExtractParsedContentFromParams < Params > > (
63
63
body : Params ,
64
64
options ?: Core . RequestOptions ,
65
- ) : Promise < ParsedChatCompletion < ParsedT > > {
65
+ ) : Core . APIPromise < ParsedChatCompletion < ParsedT > > {
66
66
validateInputTools ( body . tools ) ;
67
67
68
- const completion = await this . _client . chat . completions . create ( body , {
69
- ... options ,
70
- headers : {
71
- ... options ?. headers ,
72
- 'X-Stainless-Helper-Method' : 'beta.chat.completions.parse' ,
73
- } ,
74
- } ) ;
75
-
76
- return parseChatCompletion ( completion , body ) ;
68
+ return this . _client . chat . completions
69
+ . create ( body , {
70
+ ... options ,
71
+ headers : {
72
+ ... options ?. headers ,
73
+ 'X-Stainless-Helper-Method' : 'beta.chat.completions.parse' ,
74
+ } ,
75
+ } )
76
+ . _thenUnwrap ( ( completion ) => parseChatCompletion ( completion , body ) ) ;
77
77
}
78
78
79
79
/**
You can’t perform that action at this time.
0 commit comments