mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-04 08:27:46 +08:00
修复前端调试与基础交互问题
This commit is contained in:
@@ -1496,7 +1496,7 @@ const formatConversionPair = (source: string, target: string): string =>
|
||||
`${formatApiFormat(source.trim())} → ${formatApiFormat(target.trim())}`
|
||||
|
||||
const extractFieldDetail = (message: string): string => {
|
||||
const fieldMatch = message.match(/field\s+([^;=]+?)\s*=\s*(\"(?:\\.|[^"\\])*\"|[^;]+)/i)
|
||||
const fieldMatch = message.match(/field\s+([^;=]+?)\s*=\s*("(?:\\.|[^"\\])*"|[^;]+)/i)
|
||||
const unsupportedFieldMatch = message.match(/field\s+([^;]+?)\s+is unsupported/i)
|
||||
if (fieldMatch?.[1]) {
|
||||
return `字段 ${normalizeDiagnosticFieldPath(fieldMatch[1])} = ${fieldMatch[2].trim()}`
|
||||
|
||||
@@ -876,7 +876,7 @@ import Skeleton from '@/components/ui/skeleton.vue'
|
||||
import Tabs from '@/components/ui/tabs.vue'
|
||||
import TabsContent from '@/components/ui/tabs-content.vue'
|
||||
import { AlertTriangle, Check, Columns2, RefreshCw, X, Monitor, Server, MessageSquareText, Code2, Terminal, Play } from 'lucide-vue-next'
|
||||
import { dashboardApi, type RequestDetail, type RequestErrorDomain } from '@/api/dashboard'
|
||||
import { dashboardApi, type RequestDetail } from '@/api/dashboard'
|
||||
import type { ImageProgress, RequestTrace } from '@/api/requestTrace'
|
||||
import { formatApiFormat } from '@/api/endpoints/types/api-format'
|
||||
import {
|
||||
@@ -889,7 +889,6 @@ import { log } from '@/utils/logger'
|
||||
import { getEffectiveInputTokens } from '../token-normalization'
|
||||
import {
|
||||
formatDurationMs,
|
||||
formatOutputRate,
|
||||
formatOutputRateValue,
|
||||
getDisplayOutputRate,
|
||||
} from '../performance'
|
||||
@@ -1006,15 +1005,6 @@ type JsonRecord = Record<string, unknown>
|
||||
|
||||
const METADATA_BYTE_FIELD_PATTERN = /(^bytes$|_bytes$|bytes$)/i
|
||||
|
||||
type NormalizedErrorDomain = {
|
||||
source?: string | null
|
||||
status_code?: number | null
|
||||
type?: string | null
|
||||
message: string
|
||||
code?: string | number | null
|
||||
category?: string | null
|
||||
}
|
||||
|
||||
function asRecord(value: unknown): JsonRecord | null {
|
||||
if (!value || typeof value !== 'object' || Array.isArray(value)) return null
|
||||
return value as JsonRecord
|
||||
@@ -1043,28 +1033,6 @@ function formatMetadataDisplayValue(value: unknown, key = ''): unknown {
|
||||
return value
|
||||
}
|
||||
|
||||
function normalizeErrorDomain(domain: RequestErrorDomain | null | undefined): NormalizedErrorDomain | null {
|
||||
if (!domain || typeof domain !== 'object') return null
|
||||
const message = typeof domain.message === 'string' ? domain.message.trim() : ''
|
||||
if (!message) return null
|
||||
return {
|
||||
source: domain.source ?? null,
|
||||
status_code: domain.status_code ?? null,
|
||||
type: domain.type ?? null,
|
||||
message,
|
||||
code: domain.code ?? null,
|
||||
category: domain.category ?? null,
|
||||
}
|
||||
}
|
||||
|
||||
function formatErrorDomainMeta(domain: NormalizedErrorDomain): string {
|
||||
const parts: string[] = []
|
||||
if (domain.status_code != null) parts.push(`HTTP ${domain.status_code}`)
|
||||
if (domain.type) parts.push(domain.type)
|
||||
if (domain.source) parts.push(`source=${domain.source}`)
|
||||
return parts.join(' · ')
|
||||
}
|
||||
|
||||
function mapTraceFinalStatusToRequestStatus(
|
||||
status?: RequestTrace['final_status'] | null
|
||||
): RequestStateStatus | undefined {
|
||||
|
||||
@@ -674,16 +674,18 @@ export class OpenAIParser implements ApiFormatParser {
|
||||
: typeof chunk.delta === 'string'
|
||||
? chunk.delta
|
||||
: null
|
||||
if (key && toolCalls.has(key) && args != null) {
|
||||
toolCalls.get(key)!.args = [args]
|
||||
const toolCall = key ? toolCalls.get(key) : undefined
|
||||
if (toolCall && args != null) {
|
||||
toolCall.args = [args]
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
if (eventType === 'response.custom_tool_call_input.done') {
|
||||
const key = resolveToolKey(chunk)
|
||||
if (key && toolCalls.has(key) && typeof chunk.input === 'string') {
|
||||
toolCalls.get(key)!.args = [chunk.input]
|
||||
const toolCall = key ? toolCalls.get(key) : undefined
|
||||
if (toolCall && typeof chunk.input === 'string') {
|
||||
toolCall.args = [chunk.input]
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user