Skip to content

Commit 8cc63d3

Browse files
feat(api): Updating Assistants and Evals API schemas
1 parent e83286b commit 8cc63d3

File tree

17 files changed

+1680
-376
lines changed

17 files changed

+1680
-376
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 101
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-161ca7f1cfd7b33c1fc07d0ce25dfe4be5a7271c394f4cb526b7fb21b0729900.yml
3-
openapi_spec_hash: 602e14add4bee018c6774e320ce309b8
4-
config_hash: bdacc55eb995c15255ec82130eb8c3bb
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-5fa16b9a02985ae06e41be14946a9c325dc672fb014b3c19abca65880c6990e6.yml
3+
openapi_spec_hash: da3e669f65130043b1170048c0727890
4+
config_hash: d8d5fda350f6db77c784f35429741a2e

api.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Types:
77
- <code><a href="./src/resources/shared.ts">ComparisonFilter</a></code>
88
- <code><a href="./src/resources/shared.ts">CompoundFilter</a></code>
99
- <code><a href="./src/resources/shared.ts">ErrorObject</a></code>
10-
- <code><a href="./src/resources/shared.ts">EvalItem</a></code>
1110
- <code><a href="./src/resources/shared.ts">FunctionDefinition</a></code>
1211
- <code><a href="./src/resources/shared.ts">FunctionParameters</a></code>
1312
- <code><a href="./src/resources/shared.ts">Metadata</a></code>
@@ -305,7 +304,6 @@ Types:
305304
- <code><a href="./src/resources/vector-stores/vector-stores.ts">StaticFileChunkingStrategyObjectParam</a></code>
306305
- <code><a href="./src/resources/vector-stores/vector-stores.ts">VectorStore</a></code>
307306
- <code><a href="./src/resources/vector-stores/vector-stores.ts">VectorStoreDeleted</a></code>
308-
- <code><a href="./src/resources/vector-stores/vector-stores.ts">VectorStoreExpirationAfter</a></code>
309307
- <code><a href="./src/resources/vector-stores/vector-stores.ts">VectorStoreSearchResponse</a></code>
310308

311309
Methods:
@@ -465,7 +463,6 @@ Types:
465463
- <code><a href="./src/resources/beta/threads/threads.ts">AssistantToolChoiceOption</a></code>
466464
- <code><a href="./src/resources/beta/threads/threads.ts">Thread</a></code>
467465
- <code><a href="./src/resources/beta/threads/threads.ts">ThreadDeleted</a></code>
468-
- <code><a href="./src/resources/beta/threads/threads.ts">TruncationObject</a></code>
469466

470467
Methods:
471468

@@ -712,7 +709,6 @@ Methods:
712709
Types:
713710

714711
- <code><a href="./src/resources/evals/evals.ts">EvalCustomDataSourceConfig</a></code>
715-
- <code><a href="./src/resources/evals/evals.ts">EvalLogsDataSourceConfig</a></code>
716712
- <code><a href="./src/resources/evals/evals.ts">EvalStoredCompletionsDataSourceConfig</a></code>
717713
- <code><a href="./src/resources/evals/evals.ts">EvalCreateResponse</a></code>
718714
- <code><a href="./src/resources/evals/evals.ts">EvalRetrieveResponse</a></code>
@@ -734,10 +730,7 @@ Types:
734730

735731
- <code><a href="./src/resources/evals/runs/runs.ts">CreateEvalCompletionsRunDataSource</a></code>
736732
- <code><a href="./src/resources/evals/runs/runs.ts">CreateEvalJSONLRunDataSource</a></code>
737-
- <code><a href="./src/resources/evals/runs/runs.ts">CreateEvalResponsesRunDataSource</a></code>
738733
- <code><a href="./src/resources/evals/runs/runs.ts">EvalAPIError</a></code>
739-
- <code><a href="./src/resources/evals/runs/runs.ts">EvalJSONLFileContentSource</a></code>
740-
- <code><a href="./src/resources/evals/runs/runs.ts">EvalJSONLFileIDSource</a></code>
741734
- <code><a href="./src/resources/evals/runs/runs.ts">RunCreateResponse</a></code>
742735
- <code><a href="./src/resources/evals/runs/runs.ts">RunRetrieveResponse</a></code>
743736
- <code><a href="./src/resources/evals/runs/runs.ts">RunListResponse</a></code>

src/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ import {
7474
EvalListParams,
7575
EvalListResponse,
7676
EvalListResponsesPage,
77-
EvalLogsDataSourceConfig,
7877
EvalRetrieveResponse,
7978
EvalStoredCompletionsDataSourceConfig,
8079
EvalUpdateParams,
@@ -101,7 +100,6 @@ import {
101100
VectorStore,
102101
VectorStoreCreateParams,
103102
VectorStoreDeleted,
104-
VectorStoreExpirationAfter,
105103
VectorStoreListParams,
106104
VectorStoreSearchParams,
107105
VectorStoreSearchResponse,
@@ -502,7 +500,6 @@ export declare namespace OpenAI {
502500
type StaticFileChunkingStrategyObjectParam as StaticFileChunkingStrategyObjectParam,
503501
type VectorStore as VectorStore,
504502
type VectorStoreDeleted as VectorStoreDeleted,
505-
type VectorStoreExpirationAfter as VectorStoreExpirationAfter,
506503
type VectorStoreSearchResponse as VectorStoreSearchResponse,
507504
VectorStoresPage as VectorStoresPage,
508505
VectorStoreSearchResponsesPage as VectorStoreSearchResponsesPage,
@@ -536,7 +533,6 @@ export declare namespace OpenAI {
536533
export {
537534
Evals as Evals,
538535
type EvalCustomDataSourceConfig as EvalCustomDataSourceConfig,
539-
type EvalLogsDataSourceConfig as EvalLogsDataSourceConfig,
540536
type EvalStoredCompletionsDataSourceConfig as EvalStoredCompletionsDataSourceConfig,
541537
type EvalCreateResponse as EvalCreateResponse,
542538
type EvalRetrieveResponse as EvalRetrieveResponse,
@@ -554,7 +550,6 @@ export declare namespace OpenAI {
554550
export type ComparisonFilter = API.ComparisonFilter;
555551
export type CompoundFilter = API.CompoundFilter;
556552
export type ErrorObject = API.ErrorObject;
557-
export type EvalItem = API.EvalItem;
558553
export type FunctionDefinition = API.FunctionDefinition;
559554
export type FunctionParameters = API.FunctionParameters;
560555
export type Metadata = API.Metadata;

src/resources/beta/beta.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ import {
9090
ThreadDeleted,
9191
ThreadUpdateParams,
9292
Threads,
93-
TruncationObject,
9493
} from './threads/threads';
9594
import { Chat } from './chat/chat';
9695

@@ -189,7 +188,6 @@ export declare namespace Beta {
189188
type AssistantToolChoiceOption as AssistantToolChoiceOption,
190189
type Thread as Thread,
191190
type ThreadDeleted as ThreadDeleted,
192-
type TruncationObject as TruncationObject,
193191
type ThreadCreateParams as ThreadCreateParams,
194192
type ThreadUpdateParams as ThreadUpdateParams,
195193
type ThreadCreateAndRunParams as ThreadCreateAndRunParams,

src/resources/beta/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export {
2929
type AssistantToolChoiceOption,
3030
type Thread,
3131
type ThreadDeleted,
32-
type TruncationObject,
3332
type ThreadCreateParams,
3433
type ThreadUpdateParams,
3534
type ThreadCreateAndRunParams,

src/resources/beta/threads/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ export {
6363
type AssistantToolChoiceOption,
6464
type Thread,
6565
type ThreadDeleted,
66-
type TruncationObject,
6766
type ThreadCreateParams,
6867
type ThreadUpdateParams,
6968
type ThreadCreateAndRunParams,

src/resources/beta/threads/runs/runs.ts

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ export interface Run {
564564
* Controls for how a thread will be truncated prior to the run. Use this to
565565
* control the intial context window of the run.
566566
*/
567-
truncation_strategy: ThreadsAPI.TruncationObject | null;
567+
truncation_strategy: Run.TruncationStrategy | null;
568568

569569
/**
570570
* Usage statistics related to the run. This value will be `null` if the run is not
@@ -639,6 +639,26 @@ export namespace Run {
639639
}
640640
}
641641

642+
/**
643+
* Controls for how a thread will be truncated prior to the run. Use this to
644+
* control the intial context window of the run.
645+
*/
646+
export interface TruncationStrategy {
647+
/**
648+
* The truncation strategy to use for the thread. The default is `auto`. If set to
649+
* `last_messages`, the thread will be truncated to the n most recent messages in
650+
* the thread. When set to `auto`, messages in the middle of the thread will be
651+
* dropped to fit the context length of the model, `max_prompt_tokens`.
652+
*/
653+
type: 'auto' | 'last_messages';
654+
655+
/**
656+
* The number of most recent messages from the thread when constructing the context
657+
* for the run.
658+
*/
659+
last_messages?: number | null;
660+
}
661+
642662
/**
643663
* Usage statistics related to the run. This value will be `null` if the run is not
644664
* in a terminal state (i.e. `in_progress`, `queued`, etc.).
@@ -842,7 +862,7 @@ export interface RunCreateParamsBase {
842862
* Body param: Controls for how a thread will be truncated prior to the run. Use
843863
* this to control the intial context window of the run.
844864
*/
845-
truncation_strategy?: ThreadsAPI.TruncationObject | null;
865+
truncation_strategy?: RunCreateParams.TruncationStrategy | null;
846866
}
847867

848868
export namespace RunCreateParams {
@@ -901,6 +921,26 @@ export namespace RunCreateParams {
901921
}
902922
}
903923

924+
/**
925+
* Controls for how a thread will be truncated prior to the run. Use this to
926+
* control the intial context window of the run.
927+
*/
928+
export interface TruncationStrategy {
929+
/**
930+
* The truncation strategy to use for the thread. The default is `auto`. If set to
931+
* `last_messages`, the thread will be truncated to the n most recent messages in
932+
* the thread. When set to `auto`, messages in the middle of the thread will be
933+
* dropped to fit the context length of the model, `max_prompt_tokens`.
934+
*/
935+
type: 'auto' | 'last_messages';
936+
937+
/**
938+
* The number of most recent messages from the thread when constructing the context
939+
* for the run.
940+
*/
941+
last_messages?: number | null;
942+
}
943+
904944
export type RunCreateParamsNonStreaming = RunsAPI.RunCreateParamsNonStreaming;
905945
export type RunCreateParamsStreaming = RunsAPI.RunCreateParamsStreaming;
906946
}

src/resources/beta/threads/threads.ts

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -346,26 +346,6 @@ export interface ThreadDeleted {
346346
object: 'thread.deleted';
347347
}
348348

349-
/**
350-
* Controls for how a thread will be truncated prior to the run. Use this to
351-
* control the intial context window of the run.
352-
*/
353-
export interface TruncationObject {
354-
/**
355-
* The truncation strategy to use for the thread. The default is `auto`. If set to
356-
* `last_messages`, the thread will be truncated to the n most recent messages in
357-
* the thread. When set to `auto`, messages in the middle of the thread will be
358-
* dropped to fit the context length of the model, `max_prompt_tokens`.
359-
*/
360-
type: 'auto' | 'last_messages';
361-
362-
/**
363-
* The number of most recent messages from the thread when constructing the context
364-
* for the run.
365-
*/
366-
last_messages?: number | null;
367-
}
368-
369349
export interface ThreadCreateParams {
370350
/**
371351
* A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
@@ -754,7 +734,7 @@ export interface ThreadCreateAndRunParamsBase {
754734
* Controls for how a thread will be truncated prior to the run. Use this to
755735
* control the intial context window of the run.
756736
*/
757-
truncation_strategy?: TruncationObject | null;
737+
truncation_strategy?: ThreadCreateAndRunParams.TruncationStrategy | null;
758738
}
759739

760740
export namespace ThreadCreateAndRunParams {
@@ -985,6 +965,26 @@ export namespace ThreadCreateAndRunParams {
985965
}
986966
}
987967

968+
/**
969+
* Controls for how a thread will be truncated prior to the run. Use this to
970+
* control the intial context window of the run.
971+
*/
972+
export interface TruncationStrategy {
973+
/**
974+
* The truncation strategy to use for the thread. The default is `auto`. If set to
975+
* `last_messages`, the thread will be truncated to the n most recent messages in
976+
* the thread. When set to `auto`, messages in the middle of the thread will be
977+
* dropped to fit the context length of the model, `max_prompt_tokens`.
978+
*/
979+
type: 'auto' | 'last_messages';
980+
981+
/**
982+
* The number of most recent messages from the thread when constructing the context
983+
* for the run.
984+
*/
985+
last_messages?: number | null;
986+
}
987+
988988
export type ThreadCreateAndRunParamsNonStreaming = ThreadsAPI.ThreadCreateAndRunParamsNonStreaming;
989989
export type ThreadCreateAndRunParamsStreaming = ThreadsAPI.ThreadCreateAndRunParamsStreaming;
990990
}
@@ -1684,7 +1684,6 @@ export declare namespace Threads {
16841684
type AssistantToolChoiceOption as AssistantToolChoiceOption,
16851685
type Thread as Thread,
16861686
type ThreadDeleted as ThreadDeleted,
1687-
type TruncationObject as TruncationObject,
16881687
type ThreadCreateParams as ThreadCreateParams,
16891688
type ThreadUpdateParams as ThreadUpdateParams,
16901689
type ThreadCreateAndRunParams as ThreadCreateAndRunParams,

0 commit comments

Comments
 (0)