refactor: improve OpenAI service and tools

- Enhance OpenAI message types with tool_calls support
- Improve security validation and rate limiting
- Update utility tools and weather tool
- Minor fixes in deposit-agent and domain-register

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
kappa
2026-01-28 20:26:31 +09:00
parent 7ef0ec7594
commit e32e3c6a44
7 changed files with 238 additions and 94 deletions

View File

@@ -2,6 +2,9 @@
import type { Env } from '../types';
import { retryWithBackoff } from '../utils/retry';
import { ERROR_MESSAGES } from '../constants/messages';
import { createLogger } from '../utils/logger';
const logger = createLogger('weather');
// wttr.in API 응답 타입 정의
interface WttrCurrentCondition {
@@ -87,6 +90,7 @@ export async function executeWeather(args: { city: string }, env?: Env): Promise
습도: ${current.humidity}%
풍속: ${current.windspeedKmph} km/h`;
} catch (error) {
logger.error('날씨 조회 실패', error as Error, { city });
return `${ERROR_MESSAGES.WEATHER_SERVICE_UNAVAILABLE}: ${city}`;
}
}