Skip to content

Commit e83286b

Browse files
feat(api): manual updates
1 parent ea1d56c commit e83286b

File tree

17 files changed

+155
-447
lines changed

17 files changed

+155
-447
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 101
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-161ca7f1cfd7b33c1fc07d0ce25dfe4be5a7271c394f4cb526b7fb21b0729900.yml
33
openapi_spec_hash: 602e14add4bee018c6774e320ce309b8
4-
config_hash: 7da27f7260075e8813ddcea542fba1bf
4+
config_hash: bdacc55eb995c15255ec82130eb8c3bb

api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ 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>
1011
- <code><a href="./src/resources/shared.ts">FunctionDefinition</a></code>
1112
- <code><a href="./src/resources/shared.ts">FunctionParameters</a></code>
1213
- <code><a href="./src/resources/shared.ts">Metadata</a></code>
@@ -304,6 +305,7 @@ Types:
304305
- <code><a href="./src/resources/vector-stores/vector-stores.ts">StaticFileChunkingStrategyObjectParam</a></code>
305306
- <code><a href="./src/resources/vector-stores/vector-stores.ts">VectorStore</a></code>
306307
- <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>
307309
- <code><a href="./src/resources/vector-stores/vector-stores.ts">VectorStoreSearchResponse</a></code>
308310

309311
Methods:
@@ -463,6 +465,7 @@ Types:
463465
- <code><a href="./src/resources/beta/threads/threads.ts">AssistantToolChoiceOption</a></code>
464466
- <code><a href="./src/resources/beta/threads/threads.ts">Thread</a></code>
465467
- <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>
466469

467470
Methods:
468471

@@ -733,6 +736,8 @@ Types:
733736
- <code><a href="./src/resources/evals/runs/runs.ts">CreateEvalJSONLRunDataSource</a></code>
734737
- <code><a href="./src/resources/evals/runs/runs.ts">CreateEvalResponsesRunDataSource</a></code>
735738
- <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>
736741
- <code><a href="./src/resources/evals/runs/runs.ts">RunCreateResponse</a></code>
737742
- <code><a href="./src/resources/evals/runs/runs.ts">RunRetrieveResponse</a></code>
738743
- <code><a href="./src/resources/evals/runs/runs.ts">RunListResponse</a></code>

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ import {
101101
VectorStore,
102102
VectorStoreCreateParams,
103103
VectorStoreDeleted,
104+
VectorStoreExpirationAfter,
104105
VectorStoreListParams,
105106
VectorStoreSearchParams,
106107
VectorStoreSearchResponse,
@@ -501,6 +502,7 @@ export declare namespace OpenAI {
501502
type StaticFileChunkingStrategyObjectParam as StaticFileChunkingStrategyObjectParam,
502503
type VectorStore as VectorStore,
503504
type VectorStoreDeleted as VectorStoreDeleted,
505+
type VectorStoreExpirationAfter as VectorStoreExpirationAfter,
504506
type VectorStoreSearchResponse as VectorStoreSearchResponse,
505507
VectorStoresPage as VectorStoresPage,
506508
VectorStoreSearchResponsesPage as VectorStoreSearchResponsesPage,
@@ -552,6 +554,7 @@ export declare namespace OpenAI {
552554
export type ComparisonFilter = API.ComparisonFilter;
553555
export type CompoundFilter = API.CompoundFilter;
554556
export type ErrorObject = API.ErrorObject;
557+
export type EvalItem = API.EvalItem;
555558
export type FunctionDefinition = API.FunctionDefinition;
556559
export type FunctionParameters = API.FunctionParameters;
557560
export type Metadata = API.Metadata;

src/resources/beta/beta.ts

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

@@ -188,6 +189,7 @@ export declare namespace Beta {
188189
type AssistantToolChoiceOption as AssistantToolChoiceOption,
189190
type Thread as Thread,
190191
type ThreadDeleted as ThreadDeleted,
192+
type TruncationObject as TruncationObject,
191193
type ThreadCreateParams as ThreadCreateParams,
192194
type ThreadUpdateParams as ThreadUpdateParams,
193195
type ThreadCreateAndRunParams as ThreadCreateAndRunParams,

src/resources/beta/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export {
2929
type AssistantToolChoiceOption,
3030
type Thread,
3131
type ThreadDeleted,
32+
type TruncationObject,
3233
type ThreadCreateParams,
3334
type ThreadUpdateParams,
3435
type ThreadCreateAndRunParams,

src/resources/beta/threads/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export {
6363
type AssistantToolChoiceOption,
6464
type Thread,
6565
type ThreadDeleted,
66+
type TruncationObject,
6667
type ThreadCreateParams,
6768
type ThreadUpdateParams,
6869
type ThreadCreateAndRunParams,

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

Lines changed: 2 additions & 42 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: Run.TruncationStrategy | null;
567+
truncation_strategy: ThreadsAPI.TruncationObject | null;
568568

569569
/**
570570
* Usage statistics related to the run. This value will be `null` if the run is not
@@ -639,26 +639,6 @@ 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-
662642
/**
663643
* Usage statistics related to the run. This value will be `null` if the run is not
664644
* in a terminal state (i.e. `in_progress`, `queued`, etc.).
@@ -862,7 +842,7 @@ export interface RunCreateParamsBase {
862842
* Body param: Controls for how a thread will be truncated prior to the run. Use
863843
* this to control the intial context window of the run.
864844
*/
865-
truncation_strategy?: RunCreateParams.TruncationStrategy | null;
845+
truncation_strategy?: ThreadsAPI.TruncationObject | null;
866846
}
867847

868848
export namespace RunCreateParams {
@@ -921,26 +901,6 @@ export namespace RunCreateParams {
921901
}
922902
}
923903

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-
944904
export type RunCreateParamsNonStreaming = RunsAPI.RunCreateParamsNonStreaming;
945905
export type RunCreateParamsStreaming = RunsAPI.RunCreateParamsStreaming;
946906
}

src/resources/beta/threads/threads.ts

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,26 @@ 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+
349369
export interface ThreadCreateParams {
350370
/**
351371
* A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
@@ -734,7 +754,7 @@ export interface ThreadCreateAndRunParamsBase {
734754
* Controls for how a thread will be truncated prior to the run. Use this to
735755
* control the intial context window of the run.
736756
*/
737-
truncation_strategy?: ThreadCreateAndRunParams.TruncationStrategy | null;
757+
truncation_strategy?: TruncationObject | null;
738758
}
739759

740760
export namespace ThreadCreateAndRunParams {
@@ -965,26 +985,6 @@ export namespace ThreadCreateAndRunParams {
965985
}
966986
}
967987

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,6 +1684,7 @@ export declare namespace Threads {
16841684
type AssistantToolChoiceOption as AssistantToolChoiceOption,
16851685
type Thread as Thread,
16861686
type ThreadDeleted as ThreadDeleted,
1687+
type TruncationObject as TruncationObject,
16871688
type ThreadCreateParams as ThreadCreateParams,
16881689
type ThreadUpdateParams as ThreadUpdateParams,
16891690
type ThreadCreateAndRunParams as ThreadCreateAndRunParams,

src/resources/evals/evals.ts

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import { isRequestOptions } from '../../core';
55
import * as Core from '../../core';
66
import * as Shared from '../shared';
77
import * as GraderModelsAPI from '../graders/grader-models';
8-
import * as ResponsesAPI from '../responses/responses';
98
import * as RunsAPI from './runs/runs';
109
import {
1110
CreateEvalCompletionsRunDataSource,
1211
CreateEvalJSONLRunDataSource,
1312
CreateEvalResponsesRunDataSource,
1413
EvalAPIError,
14+
EvalJSONLFileContentSource,
15+
EvalJSONLFileIDSource,
1516
RunCancelResponse,
1617
RunCreateParams,
1718
RunCreateResponse,
@@ -633,7 +634,7 @@ export namespace EvalCreateParams {
633634
* A list of chat messages forming the prompt or context. May include variable
634635
* references to the "item" namespace, ie {{item.name}}.
635636
*/
636-
input: Array<LabelModel.SimpleInputMessage | LabelModel.EvalItem>;
637+
input: Array<LabelModel.SimpleInputMessage | Shared.EvalItem>;
637638

638639
/**
639640
* The labels to classify to each item in the evaluation.
@@ -673,48 +674,6 @@ export namespace EvalCreateParams {
673674
*/
674675
role: string;
675676
}
676-
677-
/**
678-
* A message input to the model with a role indicating instruction following
679-
* hierarchy. Instructions given with the `developer` or `system` role take
680-
* precedence over instructions given with the `user` role. Messages with the
681-
* `assistant` role are presumed to have been generated by the model in previous
682-
* interactions.
683-
*/
684-
export interface EvalItem {
685-
/**
686-
* Text inputs to the model - can contain template strings.
687-
*/
688-
content: string | ResponsesAPI.ResponseInputText | EvalItem.OutputText;
689-
690-
/**
691-
* The role of the message input. One of `user`, `assistant`, `system`, or
692-
* `developer`.
693-
*/
694-
role: 'user' | 'assistant' | 'system' | 'developer';
695-
696-
/**
697-
* The type of the message input. Always `message`.
698-
*/
699-
type?: 'message';
700-
}
701-
702-
export namespace EvalItem {
703-
/**
704-
* A text output from the model.
705-
*/
706-
export interface OutputText {
707-
/**
708-
* The text output from the model.
709-
*/
710-
text: string;
711-
712-
/**
713-
* The type of the output text. Always `output_text`.
714-
*/
715-
type: 'output_text';
716-
}
717-
}
718677
}
719678

720679
/**
@@ -805,6 +764,8 @@ export declare namespace Evals {
805764
type CreateEvalJSONLRunDataSource as CreateEvalJSONLRunDataSource,
806765
type CreateEvalResponsesRunDataSource as CreateEvalResponsesRunDataSource,
807766
type EvalAPIError as EvalAPIError,
767+
type EvalJSONLFileContentSource as EvalJSONLFileContentSource,
768+
type EvalJSONLFileIDSource as EvalJSONLFileIDSource,
808769
type RunCreateResponse as RunCreateResponse,
809770
type RunRetrieveResponse as RunRetrieveResponse,
810771
type RunListResponse as RunListResponse,

src/resources/evals/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export {
2222
type CreateEvalJSONLRunDataSource,
2323
type CreateEvalResponsesRunDataSource,
2424
type EvalAPIError,
25+
type EvalJSONLFileContentSource,
26+
type EvalJSONLFileIDSource,
2527
type RunCreateResponse,
2628
type RunRetrieveResponse,
2729
type RunListResponse,

0 commit comments

Comments
 (0)