Model Types
Types for creating, updating, and representing AI models.
ModelCreate
Schema for creating a model.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | str | ✓ | - |
summary | Any | - | |
source | Any | - | |
questionnaire_ids | List[str] | - | |
status | Any | - |
Example
- Python
- TypeScript
from credoai import ModelCreate
obj = ModelCreate(
name="example",
)
import type { ModelCreate } from '@credo-ai/sdk';
const obj: ModelCreate = {
name: 'example',
};
ModelResponse
Schema for a model response.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
id | str | ✓ | - |
name | str | ✓ | - |
summary | Any | - | |
source | Any | - | |
status | str | ✓ | - |
questionnaire_ids | List[str] | - | |
custom | bool | - | |
has_use_cases | bool | - |
Example
- Python
- TypeScript
from credoai import ModelResponse
obj = ModelResponse(
id="example",
name="example",
status="example",
)
import type { ModelResponse } from '@credo-ai/sdk';
const obj: ModelResponse = {
id: 'example',
name: 'example',
status: 'example',
};
ModelUpdate
Schema for updating a model.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | Any | - | |
summary | Any | - | |
source | Any | - | |
questionnaire_ids | Any | - | |
status | Any | - |
Example
- Python
- TypeScript
from credoai import ModelUpdate
obj = ModelUpdate(
)
import type { ModelUpdate } from '@credo-ai/sdk';
const obj: ModelUpdate = {};
ModelCreateRequest
Request wrapper for ModelCreate with validation and JSON:API support. Combines the ModelCreate data model with client request functionality, providing automatic validation and JSON:API format conversion for API requests.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
name | str | ✓ | - |
summary | ForwardRef('Optional[Any]') | - | |
source | ForwardRef('Optional[Any]') | - | |
questionnaire_ids | ForwardRef('Optional[List[str]]') | - | |
status | ForwardRef('Optional[Any]') | Example: 'none' |
Example
- Python
- TypeScript
from credoai import ModelCreateRequest
obj = ModelCreateRequest(
name="example",
)
import type { ModelCreateRequest } from '@credo-ai/sdk';
const obj: ModelCreateRequest = {
name: 'example',
};
ModelResponseWrapper
Response wrapper for ModelResponse with metadata and validation. Extends ClientResponse to provide type-safe access to ModelResponse data along with HTTP response metadata.
Fields
| Field | Type | Required | Description |
|---|---|---|---|
status_code | int | ✓ | HTTP response status code |
headers | ForwardRef('Dict[str, str]') | HTTP response headers | |
request_id | ForwardRef('Optional[str]') | Unique request identifier for tracing | |
data | ForwardRef('ModelResponse') | ✓ | Validated response data |
Example
- Python
- TypeScript
from credoai import ModelResponseWrapper
obj = ModelResponseWrapper(
status_code=123,
data=None,
)
import type { ModelResponseWrapper } from '@credo-ai/sdk';
const obj: ModelResponseWrapper = {
statusCode: 123,
data: undefined,
};