You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -2422,6 +2424,19 @@ A list of available tools (functions) that the model may suggest invoking before
2422
2424
When `tools` is passed (without `tool_results`), the `text` content in the response will be empty and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty.
2423
2425
2424
2426
2427
+
</dd>
2428
+
</dl>
2429
+
2430
+
<dl>
2431
+
<dd>
2432
+
2433
+
**strict_tools:**`typing.Optional[bool]`
2434
+
2435
+
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Strict Tools guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
2436
+
2437
+
**Note**: The first few requests with a new set of tools will take longer to process.
2438
+
2439
+
2425
2440
</dd>
2426
2441
</dl>
2427
2442
@@ -2546,7 +2561,7 @@ Used to reduce repetitiveness of generated tokens. Similar to `frequency_penalty
2546
2561
2547
2562
**k:**`typing.Optional[float]`
2548
2563
2549
-
Ensures that only the top `k` most likely tokens are considered for generation at each step. When `k` is set to `0`, k-sampling is disabled.
2564
+
Ensures that only the top `k` most likely tokens are considered for generation at each step. When `k` is set to `0`, k-sampling is disabled.
2550
2565
Defaults to `0`, min value of `0`, max value of `500`.
2551
2566
2552
2567
@@ -2576,7 +2591,7 @@ Defaults to `0.75`. min value of `0.01`, max value of `0.99`.
2576
2591
<dl>
2577
2592
<dd>
2578
2593
2579
-
**logprobs:**`typing.Optional[bool]` — Whether to return the log probabilities of the generated tokens. Defaults to false.
2594
+
**logprobs:**`typing.Optional[bool]` — Defaults to `false`. When set to `true`, the log probabilities of the generated tokens will be included in the response.
2580
2595
2581
2596
2582
2597
</dd>
@@ -2640,6 +2655,7 @@ client.v2.chat(
2640
2655
content="messages",
2641
2656
)
2642
2657
],
2658
+
stream=False,
2643
2659
)
2644
2660
2645
2661
```
@@ -2679,6 +2695,19 @@ A list of available tools (functions) that the model may suggest invoking before
2679
2695
When `tools` is passed (without `tool_results`), the `text` content in the response will be empty and the `tool_calls` field in the response will be populated with a list of tool calls that need to be made. If no calls need to be made, the `tool_calls` array will be empty.
2680
2696
2681
2697
2698
+
</dd>
2699
+
</dl>
2700
+
2701
+
<dl>
2702
+
<dd>
2703
+
2704
+
**strict_tools:**`typing.Optional[bool]`
2705
+
2706
+
When set to `true`, tool calls in the Assistant message will be forced to follow the tool definition strictly. Learn more in the [Strict Tools guide](https://docs.cohere.com/docs/structured-outputs-json#structured-outputs-tools).
2707
+
2708
+
**Note**: The first few requests with a new set of tools will take longer to process.
2709
+
2710
+
2682
2711
</dd>
2683
2712
</dl>
2684
2713
@@ -2803,7 +2832,7 @@ Used to reduce repetitiveness of generated tokens. Similar to `frequency_penalty
2803
2832
2804
2833
**k:**`typing.Optional[float]`
2805
2834
2806
-
Ensures that only the top `k` most likely tokens are considered for generation at each step. When `k` is set to `0`, k-sampling is disabled.
2835
+
Ensures that only the top `k` most likely tokens are considered for generation at each step. When `k` is set to `0`, k-sampling is disabled.
2807
2836
Defaults to `0`, min value of `0`, max value of `500`.
2808
2837
2809
2838
@@ -2833,7 +2862,7 @@ Defaults to `0.75`. min value of `0.01`, max value of `0.99`.
2833
2862
<dl>
2834
2863
<dd>
2835
2864
2836
-
**logprobs:**`typing.Optional[bool]` — Whether to return the log probabilities of the generated tokens. Defaults to false.
2865
+
**logprobs:**`typing.Optional[bool]` — Defaults to `false`. When set to `true`, the log probabilities of the generated tokens will be included in the response.
2837
2866
2838
2867
2839
2868
</dd>
@@ -3057,7 +3086,15 @@ client.v2.rerank(
3057
3086
<dl>
3058
3087
<dd>
3059
3088
3060
-
**model:**`str` — The identifier of the model to use, one of : `rerank-english-v3.0`, `rerank-multilingual-v3.0`, `rerank-english-v2.0`, `rerank-multilingual-v2.0`
If a document is provided the text fields is required and all other fields will be preserved in the response.
3080
-
3081
-
The total max chunks (length of documents * max_chunks_per_doc) must be less than 10000.
3113
+
**documents:**`typing.Sequence[str]`
3082
3114
3083
-
We recommend a maximum of 1,000 documents for optimal endpoint performance.
3084
-
3085
-
</dd>
3086
-
</dl>
3115
+
A list of texts that will be compared to the `query`.
3116
+
For optimal performance we recommend against sending more than 1,000 documents in a single request.
3087
3117
3088
-
<dl>
3089
-
<dd>
3118
+
**Note**: long documents will automatically be truncated to the value of `max_tokens_per_doc`.
3090
3119
3091
-
**top_n:**`typing.Optional[int]` — The number of most relevant documents or indices to return, defaults to the length of the documents
3120
+
**Note**: structured data should be formatted as YAML strings for best performance.
3092
3121
3093
3122
</dd>
3094
3123
</dl>
3095
3124
3096
3125
<dl>
3097
3126
<dd>
3098
3127
3099
-
**rank_fields:**`typing.Optional[typing.Sequence[str]]` — If a JSON object is provided, you can specify which keys you would like to have considered for reranking. The model will rerank based on order of the fields passed in (i.e. rank_fields=['title','author','text'] will rerank using the values in title, author, text sequentially. If the length of title, author, and text exceeds the context length of the model, the chunking will not re-consider earlier fields). If not provided, the model will use the default text field for ranking.
3128
+
**top_n:**`typing.Optional[int]` — Limits the number of returned rerank results to the specified value. If not passed, all the rerank results will be returned.
3100
3129
3101
3130
</dd>
3102
3131
</dl>
@@ -3115,7 +3144,7 @@ We recommend a maximum of 1,000 documents for optimal endpoint performance.
3115
3144
<dl>
3116
3145
<dd>
3117
3146
3118
-
**max_chunks_per_doc:**`typing.Optional[int]` — The maximum number of chunks to produce internally from a document
3147
+
**max_tokens_per_doc:**`typing.Optional[int]` — Defaults to `4096`. Long documents will be automatically truncated to the specified number of tokens.
0 commit comments