This commit is contained in:
24
src/services/runtimeItemAiDirector.ts
Normal file
24
src/services/runtimeItemAiDirector.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import type {
|
||||
RuntimeItemAiIntent,
|
||||
RuntimeItemGenerationContext,
|
||||
RuntimeItemPlan,
|
||||
} from '../types';
|
||||
import { requestJson } from './apiClient';
|
||||
|
||||
export async function generateRuntimeItemAiIntents(params: {
|
||||
context: RuntimeItemGenerationContext;
|
||||
plans: RuntimeItemPlan[];
|
||||
}) {
|
||||
const response = await requestJson<{
|
||||
intents?: RuntimeItemAiIntent[];
|
||||
}>(
|
||||
'/api/runtime/items/runtime-intent',
|
||||
{
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(params),
|
||||
},
|
||||
'运行时物品意图生成失败',
|
||||
);
|
||||
return Array.isArray(response.intents) ? response.intents : [];
|
||||
}
|
||||
Reference in New Issue
Block a user