Skip to content

Commit b9e85a0

Browse files
feat(api): api update
1 parent 77febdb commit b9e85a0

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 17
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-626e11caa9a9d011fb76829cd69007eb36ff75d5739cd487ce6ed2a0527037fc.yml
3-
openapi_spec_hash: d7460def3f498d17bb75ab935a2ff2e0
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-33d547833ca39e858d727f8d4113a6bd1da52959a6b20eab8cc8e9422615e916.yml
3+
openapi_spec_hash: 3f7d1add18604e4bd72b18de1d699a67
44
config_hash: 961b4995e909aef11a454befa56ad3d2

src/groq/resources/chat/completions.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ def create(
262262
compound_custom: Optional[completion_create_params.CompoundCustom] | Omit = omit,
263263
disable_tool_validation: bool | Omit = omit,
264264
documents: Optional[Iterable[completion_create_params.Document]] | Omit = omit,
265+
enable_citations: Optional[bool] | Omit = omit,
265266
exclude_domains: Optional[SequenceNotStr[str]] | Omit = omit,
266267
frequency_penalty: Optional[float] | Omit = omit,
267268
function_call: Optional[completion_create_params.FunctionCall] | Omit = omit,
@@ -316,6 +317,10 @@ def create(
316317
documents: A list of documents to provide context for the conversation. Each document
317318
contains text that can be referenced by the model.
318319
320+
enable_citations: Whether to enable citations in the response. When enabled, the model will
321+
include citations for information retrieved from provided documents or web
322+
searches.
323+
319324
exclude_domains: Deprecated: Use search_settings.exclude_domains instead. A list of domains to
320325
exclude from the search results when the model uses a web search tool.
321326
@@ -462,6 +467,7 @@ def create(
462467
"compound_custom": compound_custom,
463468
"disable_tool_validation": disable_tool_validation,
464469
"documents": documents,
470+
"enable_citations": enable_citations,
465471
"exclude_domains": exclude_domains,
466472
"frequency_penalty": frequency_penalty,
467473
"function_call": function_call,
@@ -736,6 +742,7 @@ async def create(
736742
compound_custom: Optional[completion_create_params.CompoundCustom] | Omit = omit,
737743
disable_tool_validation: bool | Omit = omit,
738744
documents: Optional[Iterable[completion_create_params.Document]] | Omit = omit,
745+
enable_citations: Optional[bool] | Omit = omit,
739746
exclude_domains: Optional[SequenceNotStr[str]] | Omit = omit,
740747
frequency_penalty: Optional[float] | Omit = omit,
741748
function_call: Optional[completion_create_params.FunctionCall] | Omit = omit,
@@ -790,6 +797,10 @@ async def create(
790797
documents: A list of documents to provide context for the conversation. Each document
791798
contains text that can be referenced by the model.
792799
800+
enable_citations: Whether to enable citations in the response. When enabled, the model will
801+
include citations for information retrieved from provided documents or web
802+
searches.
803+
793804
exclude_domains: Deprecated: Use search_settings.exclude_domains instead. A list of domains to
794805
exclude from the search results when the model uses a web search tool.
795806
@@ -936,6 +947,7 @@ async def create(
936947
"compound_custom": compound_custom,
937948
"disable_tool_validation": disable_tool_validation,
938949
"documents": documents,
950+
"enable_citations": enable_citations,
939951
"exclude_domains": exclude_domains,
940952
"frequency_penalty": frequency_penalty,
941953
"function_call": function_call,

src/groq/types/chat/completion_create_params.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ class CompletionCreateParams(TypedDict, total=False):
7575
Each document contains text that can be referenced by the model.
7676
"""
7777

78+
enable_citations: Optional[bool]
79+
"""Whether to enable citations in the response.
80+
81+
When enabled, the model will include citations for information retrieved from
82+
provided documents or web searches.
83+
"""
84+
7885
exclude_domains: Optional[SequenceNotStr[str]]
7986
"""
8087
Deprecated: Use search_settings.exclude_domains instead. A list of domains to

tests/api_resources/chat/test_completions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def test_method_create_with_all_params(self, client: Groq) -> None:
5353
},
5454
disable_tool_validation=True,
5555
documents=[{"text": "text"}],
56+
enable_citations=True,
5657
exclude_domains=["string"],
5758
frequency_penalty=-2,
5859
function_call="none",
@@ -184,6 +185,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncGroq) -> N
184185
},
185186
disable_tool_validation=True,
186187
documents=[{"text": "text"}],
188+
enable_citations=True,
187189
exclude_domains=["string"],
188190
frequency_penalty=-2,
189191
function_call="none",

0 commit comments

Comments
 (0)