View first 100 lines
# verify-context-windows.ts
/**
* Verify AI Service Configuration
*
* This script verifies that the model configurations in serviceConfig.ts are accurate by:
*
* 1. **Model ID Verification**: Checks that each configured model ID actually exists in the
* service's API endpoint (e.g., /models for OpenAI-compatible services).
*
* 2. **Context Window Verification**: When available, verifies that the configured context_window
* values match what the API reports. Many services don't provide this data via API.
*
* The script uses multiple data sources:
* - Primary: Each service's own API endpoint
* - Fallback: OpenRouter API (set OPENROUTER_API_KEY) for services that don't expose model info
*
* Exit codes:
* - 0: All model IDs verified (context mismatches or missing context data are OK)
* - 1: Model IDs not found in API or context window mismatches detected
*
* Usage: bun run verify-context-windows.ts
# test-import.ts
/**
* Quick test to verify ai-doc exports work correctly
*/
import { callAiService, type AiConfig, type CallAiServiceOptions } from './src/index.js';
// Test with DummyAI (no network calls)
async function testAiDocImport() {
const config: AiConfig = {
activeService: "dummyai",
models: {},
apiKeys: {}
};
const options: CallAiServiceOptions = {
serviceName: "dummyai",
systemPrompt: "Test system prompt",
userPrompt: "Test user prompt",
sourceCode: "const x = 1;",
settings: config
};