refactor: migrate Deposit Agent from Assistants API to direct function calling

- Replace OpenAI Assistants API with direct function calling (AI Gateway)
- Add action-based parameters to manage_deposit tool (like manage_domain)
- Export executeDepositFunction for direct use in openai-service.ts
- Add formatDepositResult function for consistent response formatting
- Remove DEPOSIT_AGENT_ID dependency (no longer needed)
- Update CLAUDE.md documentation

Benefits:
- Bypasses regional restrictions via AI Gateway
- 100% consistent response formatting
- No Assistants API costs
- Faster execution (no thread creation)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
kappa
2026-01-18 11:59:43 +09:00
parent 1baeb0f04c
commit edbd790538
3 changed files with 166 additions and 53 deletions

View File

@@ -9,15 +9,15 @@
* - [관리자] 대기 목록, 입금 확인/거절
*/
interface DepositContext {
export interface DepositContext {
userId: number;
telegramUserId: string;
isAdmin: boolean;
db: D1Database;
}
// 예치금 API 함수 실행
async function executeDepositFunction(
// 예치금 API 함수 실행 (export for direct use without Agent)
export async function executeDepositFunction(
funcName: string,
funcArgs: Record<string, any>,
context: DepositContext