Skip to content

Commit 9f5b83b

Browse files
committed
Merge remote-tracking branch 'stainless/main'
2 parents 93f5165 + d497ec9 commit 9f5b83b

File tree

15 files changed

+627
-33
lines changed

15 files changed

+627
-33
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: 42
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cleanlab%2Fagility-b890eea39144ced38d6196197401b71ac734bcd2343d046c04169bfab9d746f2.yml
3-
openapi_spec_hash: 50035b732d759a3bc9a00402b5ccf5c4
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cleanlab%2Fagility-f22c2d6c16f00b8d93c5db45c5586c80f1daebec0abec5ed155a17159ef44a61.yml
3+
openapi_spec_hash: 6d4b1288f7ca75879573547b316bf701
44
config_hash: 6d2156cfe279456cf3c35ba5c66be1c1

src/agility/resources/assistants/assistants.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ def create(
7474
logo_s3_key: Optional[str] | NotGiven = NOT_GIVEN,
7575
logo_text: Optional[str] | NotGiven = NOT_GIVEN,
7676
model: Optional[Literal["gpt-4o"]] | NotGiven = NOT_GIVEN,
77+
response_validation_config: Optional[Iterable[assistant_create_params.ResponseValidationConfig]]
78+
| NotGiven = NOT_GIVEN,
7779
suggested_questions: List[str] | NotGiven = NOT_GIVEN,
7880
tools: Optional[Iterable[assistant_create_params.Tool]] | NotGiven = NOT_GIVEN,
7981
url_slug: Optional[str] | NotGiven = NOT_GIVEN,
@@ -123,6 +125,7 @@ def create(
123125
"logo_s3_key": logo_s3_key,
124126
"logo_text": logo_text,
125127
"model": model,
128+
"response_validation_config": response_validation_config,
126129
"suggested_questions": suggested_questions,
127130
"tools": tools,
128131
"url_slug": url_slug,
@@ -182,6 +185,8 @@ def update(
182185
logo_s3_key: Optional[str] | NotGiven = NOT_GIVEN,
183186
logo_text: Optional[str] | NotGiven = NOT_GIVEN,
184187
model: Optional[Literal["gpt-4o"]] | NotGiven = NOT_GIVEN,
188+
response_validation_config: Optional[Iterable[assistant_update_params.ResponseValidationConfig]]
189+
| NotGiven = NOT_GIVEN,
185190
suggested_questions: List[str] | NotGiven = NOT_GIVEN,
186191
tools: Optional[Iterable[assistant_update_params.Tool]] | NotGiven = NOT_GIVEN,
187192
url_slug: Optional[str] | NotGiven = NOT_GIVEN,
@@ -234,6 +239,7 @@ def update(
234239
"logo_s3_key": logo_s3_key,
235240
"logo_text": logo_text,
236241
"model": model,
242+
"response_validation_config": response_validation_config,
237243
"suggested_questions": suggested_questions,
238244
"tools": tools,
239245
"url_slug": url_slug,
@@ -360,6 +366,8 @@ async def create(
360366
logo_s3_key: Optional[str] | NotGiven = NOT_GIVEN,
361367
logo_text: Optional[str] | NotGiven = NOT_GIVEN,
362368
model: Optional[Literal["gpt-4o"]] | NotGiven = NOT_GIVEN,
369+
response_validation_config: Optional[Iterable[assistant_create_params.ResponseValidationConfig]]
370+
| NotGiven = NOT_GIVEN,
363371
suggested_questions: List[str] | NotGiven = NOT_GIVEN,
364372
tools: Optional[Iterable[assistant_create_params.Tool]] | NotGiven = NOT_GIVEN,
365373
url_slug: Optional[str] | NotGiven = NOT_GIVEN,
@@ -409,6 +417,7 @@ async def create(
409417
"logo_s3_key": logo_s3_key,
410418
"logo_text": logo_text,
411419
"model": model,
420+
"response_validation_config": response_validation_config,
412421
"suggested_questions": suggested_questions,
413422
"tools": tools,
414423
"url_slug": url_slug,
@@ -468,6 +477,8 @@ async def update(
468477
logo_s3_key: Optional[str] | NotGiven = NOT_GIVEN,
469478
logo_text: Optional[str] | NotGiven = NOT_GIVEN,
470479
model: Optional[Literal["gpt-4o"]] | NotGiven = NOT_GIVEN,
480+
response_validation_config: Optional[Iterable[assistant_update_params.ResponseValidationConfig]]
481+
| NotGiven = NOT_GIVEN,
471482
suggested_questions: List[str] | NotGiven = NOT_GIVEN,
472483
tools: Optional[Iterable[assistant_update_params.Tool]] | NotGiven = NOT_GIVEN,
473484
url_slug: Optional[str] | NotGiven = NOT_GIVEN,
@@ -520,6 +531,7 @@ async def update(
520531
"logo_s3_key": logo_s3_key,
521532
"logo_text": logo_text,
522533
"model": model,
534+
"response_validation_config": response_validation_config,
523535
"suggested_questions": suggested_questions,
524536
"tools": tools,
525537
"url_slug": url_slug,

src/agility/resources/threads/runs.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ def create(
5959
instructions: Optional[str] | NotGiven = NOT_GIVEN,
6060
knowledge_base_id: Optional[str] | NotGiven = NOT_GIVEN,
6161
model: Optional[Literal["gpt-4o"]] | NotGiven = NOT_GIVEN,
62+
response_validation_config: Optional[Iterable[run_create_params.ResponseValidationConfig]]
63+
| NotGiven = NOT_GIVEN,
6264
tools: Optional[Iterable[run_create_params.Tool]] | NotGiven = NOT_GIVEN,
6365
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6466
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -95,6 +97,7 @@ def create(
9597
"instructions": instructions,
9698
"knowledge_base_id": knowledge_base_id,
9799
"model": model,
100+
"response_validation_config": response_validation_config,
98101
"tools": tools,
99102
},
100103
run_create_params.RunCreateParams,
@@ -190,6 +193,8 @@ def stream(
190193
instructions: Optional[str] | NotGiven = NOT_GIVEN,
191194
knowledge_base_id: Optional[str] | NotGiven = NOT_GIVEN,
192195
model: Optional[Literal["gpt-4o"]] | NotGiven = NOT_GIVEN,
196+
response_validation_config: Optional[Iterable[run_stream_params.ResponseValidationConfig]]
197+
| NotGiven = NOT_GIVEN,
193198
tools: Optional[Iterable[run_stream_params.Tool]] | NotGiven = NOT_GIVEN,
194199
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
195200
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -226,6 +231,7 @@ def stream(
226231
"instructions": instructions,
227232
"knowledge_base_id": knowledge_base_id,
228233
"model": model,
234+
"response_validation_config": response_validation_config,
229235
"tools": tools,
230236
},
231237
run_stream_params.RunStreamParams,
@@ -269,6 +275,8 @@ async def create(
269275
instructions: Optional[str] | NotGiven = NOT_GIVEN,
270276
knowledge_base_id: Optional[str] | NotGiven = NOT_GIVEN,
271277
model: Optional[Literal["gpt-4o"]] | NotGiven = NOT_GIVEN,
278+
response_validation_config: Optional[Iterable[run_create_params.ResponseValidationConfig]]
279+
| NotGiven = NOT_GIVEN,
272280
tools: Optional[Iterable[run_create_params.Tool]] | NotGiven = NOT_GIVEN,
273281
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
274282
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -305,6 +313,7 @@ async def create(
305313
"instructions": instructions,
306314
"knowledge_base_id": knowledge_base_id,
307315
"model": model,
316+
"response_validation_config": response_validation_config,
308317
"tools": tools,
309318
},
310319
run_create_params.RunCreateParams,
@@ -400,6 +409,8 @@ async def stream(
400409
instructions: Optional[str] | NotGiven = NOT_GIVEN,
401410
knowledge_base_id: Optional[str] | NotGiven = NOT_GIVEN,
402411
model: Optional[Literal["gpt-4o"]] | NotGiven = NOT_GIVEN,
412+
response_validation_config: Optional[Iterable[run_stream_params.ResponseValidationConfig]]
413+
| NotGiven = NOT_GIVEN,
403414
tools: Optional[Iterable[run_stream_params.Tool]] | NotGiven = NOT_GIVEN,
404415
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
405416
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -436,6 +447,7 @@ async def stream(
436447
"instructions": instructions,
437448
"knowledge_base_id": knowledge_base_id,
438449
"model": model,
450+
"response_validation_config": response_validation_config,
439451
"tools": tools,
440452
},
441453
run_stream_params.RunStreamParams,

src/agility/types/assistant_create_params.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import List, Union, Iterable, Optional
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

8-
__all__ = ["AssistantCreateParams", "Tool", "ToolCodexV0Tool", "ToolNoOpTool"]
8+
__all__ = ["AssistantCreateParams", "ResponseValidationConfig", "Tool", "ToolCodexV0Tool", "ToolNoOpTool"]
99

1010

1111
class AssistantCreateParams(TypedDict, total=False):
@@ -32,6 +32,8 @@ class AssistantCreateParams(TypedDict, total=False):
3232

3333
model: Optional[Literal["gpt-4o"]]
3434

35+
response_validation_config: Optional[Iterable[ResponseValidationConfig]]
36+
3537
suggested_questions: List[str]
3638
"""A list of suggested questions that can be asked to the assistant"""
3739

@@ -41,6 +43,14 @@ class AssistantCreateParams(TypedDict, total=False):
4143
"""Optional URL suffix - unique identifier for the assistant's endpoint"""
4244

4345

46+
class ResponseValidationConfig(TypedDict, total=False):
47+
is_bad_threshold: Required[float]
48+
49+
name: Required[
50+
Literal["trustworthiness", "response_helpfulness", "context_sufficiency", "response_groundedness", "query_ease"]
51+
]
52+
53+
4454
class ToolCodexV0Tool(TypedDict, total=False):
4555
access_key: Required[str]
4656

src/agility/types/assistant_list_response.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@
66

77
from .._models import BaseModel
88

9-
__all__ = ["AssistantListResponse", "Tool", "ToolCodexV0Tool", "ToolNoOpTool"]
9+
__all__ = ["AssistantListResponse", "ResponseValidationConfig", "Tool", "ToolCodexV0Tool", "ToolNoOpTool"]
10+
11+
12+
class ResponseValidationConfig(BaseModel):
13+
is_bad_threshold: float
14+
15+
name: Literal[
16+
"trustworthiness", "response_helpfulness", "context_sufficiency", "response_groundedness", "query_ease"
17+
]
1018

1119

1220
class ToolCodexV0Tool(BaseModel):
@@ -56,6 +64,8 @@ class AssistantListResponse(BaseModel):
5664

5765
model: Optional[Literal["gpt-4o"]] = None
5866

67+
response_validation_config: Optional[List[ResponseValidationConfig]] = None
68+
5969
suggested_questions: Optional[List[str]] = None
6070
"""A list of suggested questions that can be asked to the assistant"""
6171

src/agility/types/assistant_update_params.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import List, Union, Iterable, Optional
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

8-
__all__ = ["AssistantUpdateParams", "Tool", "ToolCodexV0Tool", "ToolNoOpTool"]
8+
__all__ = ["AssistantUpdateParams", "ResponseValidationConfig", "Tool", "ToolCodexV0Tool", "ToolNoOpTool"]
99

1010

1111
class AssistantUpdateParams(TypedDict, total=False):
@@ -34,6 +34,8 @@ class AssistantUpdateParams(TypedDict, total=False):
3434

3535
model: Optional[Literal["gpt-4o"]]
3636

37+
response_validation_config: Optional[Iterable[ResponseValidationConfig]]
38+
3739
suggested_questions: List[str]
3840
"""A list of suggested questions that can be asked to the assistant"""
3941

@@ -43,6 +45,14 @@ class AssistantUpdateParams(TypedDict, total=False):
4345
"""Optional URL suffix - unique identifier for the assistant's endpoint"""
4446

4547

48+
class ResponseValidationConfig(TypedDict, total=False):
49+
is_bad_threshold: Required[float]
50+
51+
name: Required[
52+
Literal["trustworthiness", "response_helpfulness", "context_sufficiency", "response_groundedness", "query_ease"]
53+
]
54+
55+
4656
class ToolCodexV0Tool(TypedDict, total=False):
4757
access_key: Required[str]
4858

src/agility/types/assistant_with_config.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@
66

77
from .._models import BaseModel
88

9-
__all__ = ["AssistantWithConfig", "Tool", "ToolCodexV0Tool", "ToolNoOpTool"]
9+
__all__ = ["AssistantWithConfig", "ResponseValidationConfig", "Tool", "ToolCodexV0Tool", "ToolNoOpTool"]
10+
11+
12+
class ResponseValidationConfig(BaseModel):
13+
is_bad_threshold: float
14+
15+
name: Literal[
16+
"trustworthiness", "response_helpfulness", "context_sufficiency", "response_groundedness", "query_ease"
17+
]
1018

1119

1220
class ToolCodexV0Tool(BaseModel):
@@ -54,6 +62,8 @@ class AssistantWithConfig(BaseModel):
5462

5563
model: Optional[Literal["gpt-4o"]] = None
5664

65+
response_validation_config: Optional[List[ResponseValidationConfig]] = None
66+
5767
suggested_questions: Optional[List[str]] = None
5868
"""A list of suggested questions that can be asked to the assistant"""
5969

src/agility/types/threads/message.py

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,98 @@
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 datetime import datetime
55
from typing_extensions import Literal
66

77
from ..._models import BaseModel
88

9-
__all__ = ["Message", "Metadata", "MetadataScores"]
9+
__all__ = [
10+
"Message",
11+
"Metadata",
12+
"MetadataScores",
13+
"MetadataScoresContextSufficiency",
14+
"MetadataScoresContextSufficiencyLog",
15+
"MetadataScoresQueryEase",
16+
"MetadataScoresQueryEaseLog",
17+
"MetadataScoresResponseGroundedness",
18+
"MetadataScoresResponseGroundednessLog",
19+
"MetadataScoresResponseHelpfulness",
20+
"MetadataScoresResponseHelpfulnessLog",
21+
"MetadataScoresTrustworthiness",
22+
"MetadataScoresTrustworthinessLog",
23+
]
24+
25+
26+
class MetadataScoresContextSufficiencyLog(BaseModel):
27+
explanation: str
28+
29+
30+
class MetadataScoresContextSufficiency(BaseModel):
31+
is_bad: Optional[bool] = None
32+
33+
log: Optional[MetadataScoresContextSufficiencyLog] = None
34+
35+
score: Optional[float] = None
36+
37+
38+
class MetadataScoresQueryEaseLog(BaseModel):
39+
explanation: str
40+
41+
42+
class MetadataScoresQueryEase(BaseModel):
43+
is_bad: Optional[bool] = None
44+
45+
log: Optional[MetadataScoresQueryEaseLog] = None
46+
47+
score: Optional[float] = None
48+
49+
50+
class MetadataScoresResponseGroundednessLog(BaseModel):
51+
explanation: str
52+
53+
54+
class MetadataScoresResponseGroundedness(BaseModel):
55+
is_bad: Optional[bool] = None
56+
57+
log: Optional[MetadataScoresResponseGroundednessLog] = None
58+
59+
score: Optional[float] = None
60+
61+
62+
class MetadataScoresResponseHelpfulnessLog(BaseModel):
63+
explanation: str
64+
65+
66+
class MetadataScoresResponseHelpfulness(BaseModel):
67+
is_bad: Optional[bool] = None
68+
69+
log: Optional[MetadataScoresResponseHelpfulnessLog] = None
70+
71+
score: Optional[float] = None
72+
73+
74+
class MetadataScoresTrustworthinessLog(BaseModel):
75+
explanation: str
76+
77+
78+
class MetadataScoresTrustworthiness(BaseModel):
79+
is_bad: Optional[bool] = None
80+
81+
log: Optional[MetadataScoresTrustworthinessLog] = None
82+
83+
score: Optional[float] = None
1084

1185

1286
class MetadataScores(BaseModel):
13-
response_helpfulness: Optional[Dict[str, object]] = None
87+
context_sufficiency: Optional[MetadataScoresContextSufficiency] = None
88+
89+
query_ease: Optional[MetadataScoresQueryEase] = None
90+
91+
response_groundedness: Optional[MetadataScoresResponseGroundedness] = None
92+
93+
response_helpfulness: Optional[MetadataScoresResponseHelpfulness] = None
1494

15-
trustworthiness: Optional[Dict[str, object]] = None
95+
trustworthiness: Optional[MetadataScoresTrustworthiness] = None
1696

1797

1898
class Metadata(BaseModel):

0 commit comments

Comments
 (0)