# InferSchemaType

# Type Alias: InferSchemaType\<T\>

```ts
type InferSchemaType<T> = T extends StandardJSONSchemaV1<infer TInput, unknown> ? TInput : T extends StandardSchemaV1<infer TInput, unknown> ? TInput : unknown;
```

Defined in: [packages/ai/src/types.ts:142](https://github.com/TanStack/ai/blob/main/packages/ai/src/types.ts#L142)

Infer the TypeScript type from a schema.
For Standard JSON Schema compliant schemas, extracts the input type.
For Standard Schema validators (e.g. Zod's `~standard` surface), extracts
the input type from the `StandardSchemaV1` shape.
For plain JSONSchema, returns `unknown` since we can't infer types from
JSON Schema at compile time.

## Type Parameters

### T

`T`
