Skip to content

Commit 51bb951

Browse files
feat(api): api update
1 parent 2aab8ae commit 51bb951

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-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-498dee72535c9b0585491899c8e5173ac2b83676710c741ef41faef415821683.yml
3-
openapi_spec_hash: aff11e3516f652d05f5416f6593994d1
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-d992d797939cfe674a14745104fb3219af457d283b625d5599d11617acf447e0.yml
3+
openapi_spec_hash: 7059cc4dcba4efaa4e14513b4f26f9ed
44
config_hash: a4a6c3089a2e53425351cc9f42b4b5aa

src/groq/types/chat/chat_completion_message.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
__all__ = [
1010
"ChatCompletionMessage",
11+
"Annotation",
12+
"AnnotationDocumentCitation",
13+
"AnnotationFunctionCitation",
1114
"ExecutedTool",
1215
"ExecutedToolBrowserResult",
1316
"ExecutedToolCodeResult",
@@ -19,6 +22,45 @@
1922
]
2023

2124

25+
class AnnotationDocumentCitation(BaseModel):
26+
document_id: str
27+
"""
28+
The ID of the document being cited, corresponding to a document provided in the
29+
request.
30+
"""
31+
32+
end_index: int
33+
"""The character index in the message content where this citation ends."""
34+
35+
start_index: int
36+
"""The character index in the message content where this citation begins."""
37+
38+
39+
class AnnotationFunctionCitation(BaseModel):
40+
end_index: int
41+
"""The character index in the message content where this citation ends."""
42+
43+
start_index: int
44+
"""The character index in the message content where this citation begins."""
45+
46+
tool_call_id: str
47+
"""
48+
The ID of the tool call being cited, corresponding to a tool call made during
49+
the conversation.
50+
"""
51+
52+
53+
class Annotation(BaseModel):
54+
type: Literal["document_citation", "function_citation"]
55+
"""The type of annotation."""
56+
57+
document_citation: Optional[AnnotationDocumentCitation] = None
58+
"""A citation referencing a specific document that was provided in the request."""
59+
60+
function_citation: Optional[AnnotationFunctionCitation] = None
61+
"""A citation referencing the result of a function or tool call."""
62+
63+
2264
class ExecutedToolBrowserResult(BaseModel):
2365
title: str
2466
"""The title of the browser window"""
@@ -189,6 +231,12 @@ class ChatCompletionMessage(BaseModel):
189231
role: Literal["assistant"]
190232
"""The role of the author of this message."""
191233

234+
annotations: Optional[List[Annotation]] = None
235+
"""
236+
A list of annotations providing citations and references for the content in the
237+
message.
238+
"""
239+
192240
executed_tools: Optional[List[ExecutedTool]] = None
193241
"""
194242
A list of tools that were executed during the chat completion for compound AI

0 commit comments

Comments
 (0)