init with react+axum+spacetimedb
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-04-26 18:06:23 +08:00
commit cbc27bad4a
20199 changed files with 883714 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
import type {
BigFishActionResponse,
BigFishSessionResponse,
BigFishSessionSnapshotResponse,
CreateBigFishSessionRequest,
ExecuteBigFishActionRequest,
SendBigFishMessageRequest,
} from '../../../packages/shared/src/contracts/bigFish';
import type { TextStreamOptions } from '../aiTypes';
import { createCreationAgentClient } from '../creation-agent';
const BIG_FISH_AGENT_API_BASE = '/api/runtime/big-fish/agent/sessions';
const bigFishAgentHttpClient = createCreationAgentClient<
CreateBigFishSessionRequest,
BigFishSessionResponse,
BigFishSessionResponse,
BigFishSessionSnapshotResponse,
SendBigFishMessageRequest,
BigFishSessionResponse,
ExecuteBigFishActionRequest,
BigFishActionResponse
>({
apiBase: BIG_FISH_AGENT_API_BASE,
messages: {
createSession: '创建大鱼吃小鱼共创会话失败',
getSession: '读取大鱼吃小鱼共创会话失败',
sendMessage: '发送大鱼吃小鱼共创消息失败',
streamIncomplete: '大鱼吃小鱼共创消息流式结果不完整',
executeAction: '执行大鱼吃小鱼共创操作失败',
},
});
export async function createBigFishCreationSession(
payload: CreateBigFishSessionRequest = {},
) {
return bigFishAgentHttpClient.createSession(payload);
}
export async function getBigFishCreationSession(sessionId: string) {
return bigFishAgentHttpClient.getSession(sessionId);
}
export async function sendBigFishCreationMessage(
sessionId: string,
payload: SendBigFishMessageRequest,
) {
return bigFishAgentHttpClient.sendMessage(sessionId, payload);
}
export async function streamBigFishCreationMessage(
sessionId: string,
payload: SendBigFishMessageRequest,
options: TextStreamOptions = {},
) {
return bigFishAgentHttpClient.streamMessage(sessionId, payload, options);
}
export async function executeBigFishCreationAction(
sessionId: string,
payload: ExecuteBigFishActionRequest,
) {
return bigFishAgentHttpClient.executeAction(sessionId, payload);
}
export const bigFishCreationClient = {
createSession: createBigFishCreationSession,
getSession: getBigFishCreationSession,
sendMessage: sendBigFishCreationMessage,
streamMessage: streamBigFishCreationMessage,
executeAction: executeBigFishCreationAction,
};

View File

@@ -0,0 +1,8 @@
export {
bigFishCreationClient,
createBigFishCreationSession,
executeBigFishCreationAction,
getBigFishCreationSession,
sendBigFishCreationMessage,
streamBigFishCreationMessage,
} from './bigFishCreationClient';