@@ -55,10 +55,11 @@ def chat(
55
55
self ,
56
56
* ,
57
57
messages : Iterable [chat_chat_params .Message ],
58
- model : Literal [ "palmyra-x-004" , "palmyra-fin" , "palmyra-med" , "palmyra-creative" , "palmyra-x-003-instruct" ] ,
58
+ model : str ,
59
59
logprobs : bool | NotGiven = NOT_GIVEN ,
60
60
max_tokens : int | NotGiven = NOT_GIVEN ,
61
61
n : int | NotGiven = NOT_GIVEN ,
62
+ response_format : chat_chat_params .ResponseFormat | NotGiven = NOT_GIVEN ,
62
63
stop : Union [List [str ], str ] | NotGiven = NOT_GIVEN ,
63
64
stream : Literal [False ] | NotGiven = NOT_GIVEN ,
64
65
stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
@@ -84,7 +85,8 @@ def chat(
84
85
the model to respond to. The array must contain at least one message.
85
86
86
87
model: The [ID of the model](https://dev.writer.com/home/models) to use for creating
87
- the chat completion.
88
+ the chat completion. Supports `palmyra-x-004`, `palmyra-fin`, `palmyra-med`,
89
+ `palmyra-creative`, and `palmyra-x-003-instruct`.
88
90
89
91
logprobs: Specifies whether to return log probabilities of the output tokens.
90
92
@@ -96,6 +98,13 @@ def chat(
96
98
single request. This parameter allows for generating multiple responses,
97
99
offering a variety of potential replies from which to choose.
98
100
101
+ response_format: The response format to use for the chat completion, available with
102
+ `palmyra-x-004`.
103
+
104
+ `text` is the default response format. [JSON Schema](https://json-schema.org/)
105
+ is supported for structured responses. If you specify `json_schema`, you must
106
+ also provide a `json_schema` object.
107
+
99
108
stop: A token or sequence of tokens that, when generated, will cause the model to stop
100
109
producing further content. This can be a single token or an array of tokens,
101
110
acting as a signal to end the output.
@@ -142,11 +151,12 @@ def chat(
142
151
self ,
143
152
* ,
144
153
messages : Iterable [chat_chat_params .Message ],
145
- model : Literal [ "palmyra-x-004" , "palmyra-fin" , "palmyra-med" , "palmyra-creative" , "palmyra-x-003-instruct" ] ,
154
+ model : str ,
146
155
stream : Literal [True ],
147
156
logprobs : bool | NotGiven = NOT_GIVEN ,
148
157
max_tokens : int | NotGiven = NOT_GIVEN ,
149
158
n : int | NotGiven = NOT_GIVEN ,
159
+ response_format : chat_chat_params .ResponseFormat | NotGiven = NOT_GIVEN ,
150
160
stop : Union [List [str ], str ] | NotGiven = NOT_GIVEN ,
151
161
stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
152
162
temperature : float | NotGiven = NOT_GIVEN ,
@@ -171,7 +181,8 @@ def chat(
171
181
the model to respond to. The array must contain at least one message.
172
182
173
183
model: The [ID of the model](https://dev.writer.com/home/models) to use for creating
174
- the chat completion.
184
+ the chat completion. Supports `palmyra-x-004`, `palmyra-fin`, `palmyra-med`,
185
+ `palmyra-creative`, and `palmyra-x-003-instruct`.
175
186
176
187
stream: Indicates whether the response should be streamed incrementally as it is
177
188
generated or only returned once fully complete. Streaming can be useful for
@@ -187,6 +198,13 @@ def chat(
187
198
single request. This parameter allows for generating multiple responses,
188
199
offering a variety of potential replies from which to choose.
189
200
201
+ response_format: The response format to use for the chat completion, available with
202
+ `palmyra-x-004`.
203
+
204
+ `text` is the default response format. [JSON Schema](https://json-schema.org/)
205
+ is supported for structured responses. If you specify `json_schema`, you must
206
+ also provide a `json_schema` object.
207
+
190
208
stop: A token or sequence of tokens that, when generated, will cause the model to stop
191
209
producing further content. This can be a single token or an array of tokens,
192
210
acting as a signal to end the output.
@@ -229,11 +247,12 @@ def chat(
229
247
self ,
230
248
* ,
231
249
messages : Iterable [chat_chat_params .Message ],
232
- model : Literal [ "palmyra-x-004" , "palmyra-fin" , "palmyra-med" , "palmyra-creative" , "palmyra-x-003-instruct" ] ,
250
+ model : str ,
233
251
stream : bool ,
234
252
logprobs : bool | NotGiven = NOT_GIVEN ,
235
253
max_tokens : int | NotGiven = NOT_GIVEN ,
236
254
n : int | NotGiven = NOT_GIVEN ,
255
+ response_format : chat_chat_params .ResponseFormat | NotGiven = NOT_GIVEN ,
237
256
stop : Union [List [str ], str ] | NotGiven = NOT_GIVEN ,
238
257
stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
239
258
temperature : float | NotGiven = NOT_GIVEN ,
@@ -258,7 +277,8 @@ def chat(
258
277
the model to respond to. The array must contain at least one message.
259
278
260
279
model: The [ID of the model](https://dev.writer.com/home/models) to use for creating
261
- the chat completion.
280
+ the chat completion. Supports `palmyra-x-004`, `palmyra-fin`, `palmyra-med`,
281
+ `palmyra-creative`, and `palmyra-x-003-instruct`.
262
282
263
283
stream: Indicates whether the response should be streamed incrementally as it is
264
284
generated or only returned once fully complete. Streaming can be useful for
@@ -274,6 +294,13 @@ def chat(
274
294
single request. This parameter allows for generating multiple responses,
275
295
offering a variety of potential replies from which to choose.
276
296
297
+ response_format: The response format to use for the chat completion, available with
298
+ `palmyra-x-004`.
299
+
300
+ `text` is the default response format. [JSON Schema](https://json-schema.org/)
301
+ is supported for structured responses. If you specify `json_schema`, you must
302
+ also provide a `json_schema` object.
303
+
277
304
stop: A token or sequence of tokens that, when generated, will cause the model to stop
278
305
producing further content. This can be a single token or an array of tokens,
279
306
acting as a signal to end the output.
@@ -316,10 +343,11 @@ def chat(
316
343
self ,
317
344
* ,
318
345
messages : Iterable [chat_chat_params .Message ],
319
- model : Literal [ "palmyra-x-004" , "palmyra-fin" , "palmyra-med" , "palmyra-creative" , "palmyra-x-003-instruct" ] ,
346
+ model : str ,
320
347
logprobs : bool | NotGiven = NOT_GIVEN ,
321
348
max_tokens : int | NotGiven = NOT_GIVEN ,
322
349
n : int | NotGiven = NOT_GIVEN ,
350
+ response_format : chat_chat_params .ResponseFormat | NotGiven = NOT_GIVEN ,
323
351
stop : Union [List [str ], str ] | NotGiven = NOT_GIVEN ,
324
352
stream : Literal [False ] | Literal [True ] | NotGiven = NOT_GIVEN ,
325
353
stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
@@ -343,6 +371,7 @@ def chat(
343
371
"logprobs" : logprobs ,
344
372
"max_tokens" : max_tokens ,
345
373
"n" : n ,
374
+ "response_format" : response_format ,
346
375
"stop" : stop ,
347
376
"stream" : stream ,
348
377
"stream_options" : stream_options ,
@@ -457,10 +486,11 @@ async def chat(
457
486
self ,
458
487
* ,
459
488
messages : Iterable [chat_chat_params .Message ],
460
- model : Literal [ "palmyra-x-004" , "palmyra-fin" , "palmyra-med" , "palmyra-creative" , "palmyra-x-003-instruct" ] ,
489
+ model : str ,
461
490
logprobs : bool | NotGiven = NOT_GIVEN ,
462
491
max_tokens : int | NotGiven = NOT_GIVEN ,
463
492
n : int | NotGiven = NOT_GIVEN ,
493
+ response_format : chat_chat_params .ResponseFormat | NotGiven = NOT_GIVEN ,
464
494
stop : Union [List [str ], str ] | NotGiven = NOT_GIVEN ,
465
495
stream : Literal [False ] | NotGiven = NOT_GIVEN ,
466
496
stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
@@ -486,7 +516,8 @@ async def chat(
486
516
the model to respond to. The array must contain at least one message.
487
517
488
518
model: The [ID of the model](https://dev.writer.com/home/models) to use for creating
489
- the chat completion.
519
+ the chat completion. Supports `palmyra-x-004`, `palmyra-fin`, `palmyra-med`,
520
+ `palmyra-creative`, and `palmyra-x-003-instruct`.
490
521
491
522
logprobs: Specifies whether to return log probabilities of the output tokens.
492
523
@@ -498,6 +529,13 @@ async def chat(
498
529
single request. This parameter allows for generating multiple responses,
499
530
offering a variety of potential replies from which to choose.
500
531
532
+ response_format: The response format to use for the chat completion, available with
533
+ `palmyra-x-004`.
534
+
535
+ `text` is the default response format. [JSON Schema](https://json-schema.org/)
536
+ is supported for structured responses. If you specify `json_schema`, you must
537
+ also provide a `json_schema` object.
538
+
501
539
stop: A token or sequence of tokens that, when generated, will cause the model to stop
502
540
producing further content. This can be a single token or an array of tokens,
503
541
acting as a signal to end the output.
@@ -544,11 +582,12 @@ async def chat(
544
582
self ,
545
583
* ,
546
584
messages : Iterable [chat_chat_params .Message ],
547
- model : Literal [ "palmyra-x-004" , "palmyra-fin" , "palmyra-med" , "palmyra-creative" , "palmyra-x-003-instruct" ] ,
585
+ model : str ,
548
586
stream : Literal [True ],
549
587
logprobs : bool | NotGiven = NOT_GIVEN ,
550
588
max_tokens : int | NotGiven = NOT_GIVEN ,
551
589
n : int | NotGiven = NOT_GIVEN ,
590
+ response_format : chat_chat_params .ResponseFormat | NotGiven = NOT_GIVEN ,
552
591
stop : Union [List [str ], str ] | NotGiven = NOT_GIVEN ,
553
592
stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
554
593
temperature : float | NotGiven = NOT_GIVEN ,
@@ -573,7 +612,8 @@ async def chat(
573
612
the model to respond to. The array must contain at least one message.
574
613
575
614
model: The [ID of the model](https://dev.writer.com/home/models) to use for creating
576
- the chat completion.
615
+ the chat completion. Supports `palmyra-x-004`, `palmyra-fin`, `palmyra-med`,
616
+ `palmyra-creative`, and `palmyra-x-003-instruct`.
577
617
578
618
stream: Indicates whether the response should be streamed incrementally as it is
579
619
generated or only returned once fully complete. Streaming can be useful for
@@ -589,6 +629,13 @@ async def chat(
589
629
single request. This parameter allows for generating multiple responses,
590
630
offering a variety of potential replies from which to choose.
591
631
632
+ response_format: The response format to use for the chat completion, available with
633
+ `palmyra-x-004`.
634
+
635
+ `text` is the default response format. [JSON Schema](https://json-schema.org/)
636
+ is supported for structured responses. If you specify `json_schema`, you must
637
+ also provide a `json_schema` object.
638
+
592
639
stop: A token or sequence of tokens that, when generated, will cause the model to stop
593
640
producing further content. This can be a single token or an array of tokens,
594
641
acting as a signal to end the output.
@@ -631,11 +678,12 @@ async def chat(
631
678
self ,
632
679
* ,
633
680
messages : Iterable [chat_chat_params .Message ],
634
- model : Literal [ "palmyra-x-004" , "palmyra-fin" , "palmyra-med" , "palmyra-creative" , "palmyra-x-003-instruct" ] ,
681
+ model : str ,
635
682
stream : bool ,
636
683
logprobs : bool | NotGiven = NOT_GIVEN ,
637
684
max_tokens : int | NotGiven = NOT_GIVEN ,
638
685
n : int | NotGiven = NOT_GIVEN ,
686
+ response_format : chat_chat_params .ResponseFormat | NotGiven = NOT_GIVEN ,
639
687
stop : Union [List [str ], str ] | NotGiven = NOT_GIVEN ,
640
688
stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
641
689
temperature : float | NotGiven = NOT_GIVEN ,
@@ -660,7 +708,8 @@ async def chat(
660
708
the model to respond to. The array must contain at least one message.
661
709
662
710
model: The [ID of the model](https://dev.writer.com/home/models) to use for creating
663
- the chat completion.
711
+ the chat completion. Supports `palmyra-x-004`, `palmyra-fin`, `palmyra-med`,
712
+ `palmyra-creative`, and `palmyra-x-003-instruct`.
664
713
665
714
stream: Indicates whether the response should be streamed incrementally as it is
666
715
generated or only returned once fully complete. Streaming can be useful for
@@ -676,6 +725,13 @@ async def chat(
676
725
single request. This parameter allows for generating multiple responses,
677
726
offering a variety of potential replies from which to choose.
678
727
728
+ response_format: The response format to use for the chat completion, available with
729
+ `palmyra-x-004`.
730
+
731
+ `text` is the default response format. [JSON Schema](https://json-schema.org/)
732
+ is supported for structured responses. If you specify `json_schema`, you must
733
+ also provide a `json_schema` object.
734
+
679
735
stop: A token or sequence of tokens that, when generated, will cause the model to stop
680
736
producing further content. This can be a single token or an array of tokens,
681
737
acting as a signal to end the output.
@@ -718,10 +774,11 @@ async def chat(
718
774
self ,
719
775
* ,
720
776
messages : Iterable [chat_chat_params .Message ],
721
- model : Literal [ "palmyra-x-004" , "palmyra-fin" , "palmyra-med" , "palmyra-creative" , "palmyra-x-003-instruct" ] ,
777
+ model : str ,
722
778
logprobs : bool | NotGiven = NOT_GIVEN ,
723
779
max_tokens : int | NotGiven = NOT_GIVEN ,
724
780
n : int | NotGiven = NOT_GIVEN ,
781
+ response_format : chat_chat_params .ResponseFormat | NotGiven = NOT_GIVEN ,
725
782
stop : Union [List [str ], str ] | NotGiven = NOT_GIVEN ,
726
783
stream : Literal [False ] | Literal [True ] | NotGiven = NOT_GIVEN ,
727
784
stream_options : chat_chat_params .StreamOptions | NotGiven = NOT_GIVEN ,
@@ -745,6 +802,7 @@ async def chat(
745
802
"logprobs" : logprobs ,
746
803
"max_tokens" : max_tokens ,
747
804
"n" : n ,
805
+ "response_format" : response_format ,
748
806
"stop" : stop ,
749
807
"stream" : stream ,
750
808
"stream_options" : stream_options ,
0 commit comments