Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/Http/Requests/StoreChatRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public function rules(): array
return [
'message' => ['required', 'string', 'max:10000'],
'ai_model_id' => ['required', 'integer', 'exists:ai_models,id'],
'agent_id' => ['nullable', 'integer', 'exists:agents,id'],
];
}
}
1 change: 1 addition & 0 deletions app/Http/Requests/UpdateChatRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function rules(): array
return [
'ai_model_id' => ['sometimes', 'integer', 'exists:ai_models,id'],
'title' => ['sometimes', 'string', 'max:255'],
'agent_id' => ['sometimes', 'nullable', 'integer', 'exists:agents,id'],
];
}
}
50 changes: 40 additions & 10 deletions resources/js/types/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export enum ArtifactType {
}

export interface Artifact {
id: string;
id: number;
message_id: string;
identifier: string;
type: ArtifactType;
Expand All @@ -51,23 +51,53 @@ export interface Message {
}

export interface Chat {
id: string;
id: number;
user_id: number;
title: string;
ai_model_id: number;
ai_model?: Model;
ai_model?: AiModel;
agent_id?: number | null;
agent?: Agent | null;
created_at: string;
updated_at: string;
messages?: Message[];
}

export interface Model {
export interface AiModel {
id: number;
name: string;
description: string;
provider: string;
model_id: string; supports_tools: boolean;
supports_vision: boolean;
context_window: number;
speed_tier: string;
cost_tier: string;}

export interface Agent {
id: number;
name: string;
description: string;
user_id: number | null;
default_model_id: number | null;
system_prompt: string | null;
avatar: string | null;
tools: string[] | null;
capabilities: string[] | null;
is_active: boolean;
created_at: string;
updated_at: string;
default_model?: AiModel;
}

export interface ToolOption {
id: number;
name: string;
description: string;
}

export interface CapabilityOption {
id: number;
name: string;
model_id: string;
description: string | null;
provider?: string;
supports_tools?: boolean;
supports_vision?: boolean;
enabled?: boolean;
description: string;
}