Skip to content

Commit e8ede14

Browse files
feat(api): api update
1 parent 3c06879 commit e8ede14

7 files changed

Lines changed: 17 additions & 70 deletions

.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-9b7366da77e4d61cab54d549c9614b6dcf4ab00dbbee7453b7e49a226eba594a.yml
3-
openapi_spec_hash: f467a29e012cad77dbc4ed66042c9751
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/groqcloud%2Fgroqcloud-df1532d12363830ffbb362ddd900b3df5a998202eb5cc870eb2c7b8f1ae3a729.yml
3+
openapi_spec_hash: 122a111242b621411af740eda3c9b25c
44
config_hash: 6b1c374dcc1ffa3165dd22f52a77ff89

src/groq/types/chat/chat_completion.py

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, List, Optional
3+
from typing import List, Optional
44
from typing_extensions import Literal
55

66
from ..._models import BaseModel
77
from ..completion_usage import CompletionUsage
88
from .chat_completion_message import ChatCompletionMessage
99
from .chat_completion_token_logprob import ChatCompletionTokenLogprob
1010

11-
__all__ = [
12-
"ChatCompletion",
13-
"Choice",
14-
"ChoiceLogprobs",
15-
"McpListTool",
16-
"McpListToolTool",
17-
"UsageBreakdown",
18-
"UsageBreakdownModel",
19-
]
11+
__all__ = ["ChatCompletion", "Choice", "ChoiceLogprobs", "UsageBreakdown", "UsageBreakdownModel"]
2012

2113

2214
class ChoiceLogprobs(BaseModel):
@@ -44,31 +36,6 @@ class Choice(BaseModel):
4436
"""A chat completion message generated by the model."""
4537

4638

47-
class McpListToolTool(BaseModel):
48-
description: str
49-
"""The description of the discovered tool"""
50-
51-
input_schema: Dict[str, object]
52-
"""JSON schema describing the tool's input parameters"""
53-
54-
name: str
55-
"""The name of the discovered tool"""
56-
57-
58-
class McpListTool(BaseModel):
59-
id: str
60-
"""Unique identifier for the MCP discovery operation"""
61-
62-
server_label: str
63-
"""Label or identifier for the MCP server"""
64-
65-
tools: List[McpListToolTool]
66-
"""List of tools discovered from the MCP server"""
67-
68-
type: Literal["mcp_list_tools"]
69-
"""The type of output, always "mcp_list_tools" """
70-
71-
7239
class UsageBreakdownModel(BaseModel):
7340
model: str
7441
"""The name/identifier of the model used"""
@@ -101,9 +68,6 @@ class ChatCompletion(BaseModel):
10168
object: Literal["chat.completion"]
10269
"""The object type, which is always `chat.completion`."""
10370

104-
mcp_list_tools: Optional[List[McpListTool]] = None
105-
"""List of tools discovered from MCP servers during the request."""
106-
10771
system_fingerprint: Optional[str] = None
10872
"""This fingerprint represents the backend configuration that the model runs with.
10973

src/groq/types/chat/chat_completion_message_tool_call.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ class ChatCompletionMessageToolCall(BaseModel):
2727
function: Function
2828
"""The function that the model called."""
2929

30-
type: Literal["function", "mcp"]
31-
"""The type of the tool. Currently, `function` and `mcp` are supported."""
30+
type: Literal["function"]
31+
"""The type of the tool. Currently, only `function` is supported."""

src/groq/types/chat/chat_completion_message_tool_call_param.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ class ChatCompletionMessageToolCallParam(TypedDict, total=False):
2727
function: Required[Function]
2828
"""The function that the model called."""
2929

30-
type: Required[Literal["function", "mcp"]]
31-
"""The type of the tool. Currently, `function` and `mcp` are supported."""
30+
type: Required[Literal["function"]]
31+
"""The type of the tool. Currently, only `function` is supported."""

src/groq/types/chat/chat_completion_named_tool_choice_param.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ class Function(TypedDict, total=False):
1515
class ChatCompletionNamedToolChoiceParam(TypedDict, total=False):
1616
function: Required[Function]
1717

18-
type: Required[Literal["function", "mcp"]]
19-
"""The type of the tool. Currently, `function` and `mcp` are supported."""
18+
type: Required[Literal["function"]]
19+
"""The type of the tool. Currently, only `function` is supported."""

src/groq/types/chat/chat_completion_tool_param.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,15 @@
22

33
from __future__ import annotations
44

5-
from typing import Union
6-
from typing_extensions import Literal, Required, TypeAlias, TypedDict
5+
from typing_extensions import Literal, Required, TypedDict
76

87
from ..shared_params.function_definition import FunctionDefinition
98

10-
__all__ = ["ChatCompletionToolParam", "UnionMember0", "UnionMember1"]
9+
__all__ = ["ChatCompletionToolParam"]
1110

1211

13-
class UnionMember0(TypedDict, total=False):
14-
function: Required[FunctionDefinition]
15-
16-
server_url: str
17-
"""The URL of the MCP server to connect to (required for MCP tools)."""
18-
19-
type: Literal["function"]
20-
21-
22-
class UnionMember1(TypedDict, total=False):
23-
server_url: Required[str]
24-
"""The URL of the MCP server to connect to (required for MCP tools)."""
12+
class ChatCompletionToolParam(TypedDict, total=False):
13+
type: Required[Literal["function"]]
14+
"""The type of the tool. Currently, only `function` is supported."""
2515

2616
function: FunctionDefinition
27-
28-
type: Literal["mcp"]
29-
30-
31-
ChatCompletionToolParam: TypeAlias = Union[UnionMember0, UnionMember1]

tests/api_resources/chat/test_completions.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,12 @@ def test_method_create_with_all_params(self, client: Groq) -> None:
7878
tool_choice="none",
7979
tools=[
8080
{
81+
"type": "function",
8182
"function": {
8283
"name": "name",
8384
"description": "description",
8485
"parameters": {"foo": "bar"},
8586
},
86-
"server_url": "server_url",
87-
"type": "function",
8887
}
8988
],
9089
top_logprobs=0,
@@ -196,13 +195,12 @@ async def test_method_create_with_all_params(self, async_client: AsyncGroq) -> N
196195
tool_choice="none",
197196
tools=[
198197
{
198+
"type": "function",
199199
"function": {
200200
"name": "name",
201201
"description": "description",
202202
"parameters": {"foo": "bar"},
203203
},
204-
"server_url": "server_url",
205-
"type": "function",
206204
}
207205
],
208206
top_logprobs=0,

0 commit comments

Comments
 (0)