Skip to content

Commit 9cec6ea

Browse files
committed
Allow raw json in responseSchema
1 parent ad4935b commit 9cec6ea

File tree

2 files changed

+5007
-5727
lines changed

2 files changed

+5007
-5727
lines changed

packages/vertexai/src/types/requests.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
HarmBlockThreshold,
2424
HarmCategory
2525
} from './enums';
26-
import { ObjectSchemaInterface } from './schema';
26+
import { ObjectSchemaInterface, SchemaRequest } from './schema';
2727

2828
/**
2929
* Base parameters for a number of methods.
@@ -86,11 +86,14 @@ export interface GenerationConfig {
8686
*/
8787
responseMimeType?: string;
8888
/**
89-
* Output response schema of the generated candidate text.
89+
* Output response schema of the generated candidate text. This
90+
* value can be a class generated with a {@link Schema} static method
91+
* like `Schema.string()` or `Schema.object()` or it can be a plain
92+
* JS object matching the {@link SchemaRequest} interface.
9093
* Note: This only applies when the specified `responseMIMEType` supports a schema; currently
9194
* this is limited to `application/json`.
9295
*/
93-
responseSchema?: TypedSchema;
96+
responseSchema?: TypedSchema | SchemaRequest;
9497
}
9598

9699
/**

0 commit comments

Comments
 (0)