mirror of
https://github.com/leonvanzyl/autocoder.git
synced 2026-01-31 14:43:35 +00:00
Merge branch 'master' into feature/expand-project-with-ai
This commit is contained in:
@@ -18,6 +18,9 @@ import type {
|
||||
PathValidationResponse,
|
||||
AssistantConversation,
|
||||
AssistantConversationDetail,
|
||||
Settings,
|
||||
SettingsUpdate,
|
||||
ModelsResponse,
|
||||
} from './types'
|
||||
|
||||
const API_BASE = '/api'
|
||||
@@ -279,3 +282,22 @@ export async function deleteAssistantConversation(
|
||||
{ method: 'DELETE' }
|
||||
)
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Settings API
|
||||
// ============================================================================
|
||||
|
||||
export async function getAvailableModels(): Promise<ModelsResponse> {
|
||||
return fetchJSON('/settings/models')
|
||||
}
|
||||
|
||||
export async function getSettings(): Promise<Settings> {
|
||||
return fetchJSON('/settings')
|
||||
}
|
||||
|
||||
export async function updateSettings(settings: SettingsUpdate): Promise<Settings> {
|
||||
return fetchJSON('/settings', {
|
||||
method: 'PATCH',
|
||||
body: JSON.stringify(settings),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ export interface AgentStatusResponse {
|
||||
pid: number | null
|
||||
started_at: string | null
|
||||
yolo_mode: boolean
|
||||
model: string | null // Model being used by running agent
|
||||
}
|
||||
|
||||
export interface AgentActionResponse {
|
||||
@@ -328,4 +329,25 @@ export interface FeatureBulkCreate {
|
||||
export interface FeatureBulkCreateResponse {
|
||||
created: number
|
||||
features: Feature[]
|
||||
// Settings Types
|
||||
// ============================================================================
|
||||
|
||||
export interface ModelInfo {
|
||||
id: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export interface ModelsResponse {
|
||||
models: ModelInfo[]
|
||||
default: string
|
||||
}
|
||||
|
||||
export interface Settings {
|
||||
yolo_mode: boolean
|
||||
model: string
|
||||
}
|
||||
|
||||
export interface SettingsUpdate {
|
||||
yolo_mode?: boolean
|
||||
model?: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user