@duckmind/deepquark-darwin-arm64 0.9.83 โ 0.9.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.deepquark/skills/bundled/knowledge-graph/SKILL.md +385 -0
- package/.deepquark/skills/bundled/knowledge-graph/STANDARDS.md +461 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/cli.ts +588 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/config.ts +630 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/connection-profile.ts +629 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/container.ts +756 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/mcp-client.ts +1310 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/output-formatter.ts +997 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/token-metrics.ts +335 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/transformation-log.ts +137 -0
- package/.deepquark/skills/bundled/knowledge-graph/lib/wrapper-config.ts +113 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/.env.example +129 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/compare-embeddings.ts +175 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/config-falkordb.yaml +108 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/config-neo4j.yaml +111 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/diagnose.ts +483 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-falkordb-dev.yml +146 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-falkordb.yml +151 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-neo4j-dev-local.yml +161 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-neo4j-dev.yml +161 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-neo4j.yml +169 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-production.yml +128 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose-test.yml +10 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/docker-compose.yml +84 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/entrypoint.sh +40 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/install.ts +2054 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/podman-compose-falkordb.yml +78 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/podman-compose-neo4j.yml +88 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/podman-compose.yml +83 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-all-llms-mcp.ts +387 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-embedding-models.ts +201 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-embedding-providers.ts +641 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-graphiti-model.ts +217 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-grok-correct.ts +141 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-grok-llms-mcp.ts +386 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-grok-models.ts +173 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-llama-extraction.ts +188 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-mcp-final.ts +240 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-mcp-live.ts +187 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-mcp-session.ts +127 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-model-combinations.ts +316 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-ollama-models.ts +228 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-openrouter-models.ts +460 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-real-life-mcp.ts +311 -0
- package/.deepquark/skills/bundled/knowledge-graph/server/test-search-debug.ts +199 -0
- package/.deepquark/skills/bundled/knowledge-graph/tools/Install.md +104 -0
- package/.deepquark/skills/bundled/knowledge-graph/tools/README.md +120 -0
- package/.deepquark/skills/bundled/knowledge-graph/tools/knowledge-cli.ts +996 -0
- package/.deepquark/skills/bundled/knowledge-graph/tools/server-cli.ts +531 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/BulkImport.md +514 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/CaptureEpisode.md +242 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/ClearGraph.md +392 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/GetRecent.md +352 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/GetStatus.md +373 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/HealthReport.md +212 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/InvestigateEntity.md +142 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/OntologyManagement.md +201 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/RunMaintenance.md +302 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/SearchByDate.md +255 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/SearchFacts.md +382 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/SearchKnowledge.md +374 -0
- package/.deepquark/skills/bundled/knowledge-graph/workflows/StixImport.md +212 -0
- package/bin/deepquark +0 -0
- package/package.json +1 -1
- package/.deepquark/skills/bundled/ge-payroll/SKILL.md +0 -153
- package/.deepquark/skills/bundled/ge-payroll/evals/evals.json +0 -23
- package/.deepquark/skills/bundled/ge-payroll/references/pain-points-improvements.md +0 -106
- package/.deepquark/skills/bundled/ge-payroll/references/process-detail.md +0 -217
- package/.deepquark/skills/bundled/ge-payroll/references/raci-stakeholders.md +0 -85
- package/.deepquark/skills/bundled/ge-payroll/references/timeline-mandays.md +0 -64
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
/**
|
|
3
|
+
* Test actual Graphiti add_memory with the configured LLM model
|
|
4
|
+
* This tests against real Pydantic schemas, not just basic JSON
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const MCP_URL = 'http://localhost:8000/mcp';
|
|
8
|
+
|
|
9
|
+
interface MCPRequest {
|
|
10
|
+
jsonrpc: '2.0';
|
|
11
|
+
id: number;
|
|
12
|
+
method: string;
|
|
13
|
+
params?: Record<string, any>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface MCPResponse {
|
|
17
|
+
jsonrpc: '2.0';
|
|
18
|
+
id: number;
|
|
19
|
+
result?: any;
|
|
20
|
+
error?: { code: number; message: string };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
let globalSessionId: string | null = null;
|
|
24
|
+
|
|
25
|
+
async function makeRequest(request: MCPRequest): Promise<MCPResponse> {
|
|
26
|
+
const headers: Record<string, string> = {
|
|
27
|
+
'Content-Type': 'application/json',
|
|
28
|
+
Accept: 'application/json, text/event-stream',
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
if (globalSessionId) {
|
|
32
|
+
// Server returns mcp-session-id, expects Mcp-Session-Id in requests
|
|
33
|
+
headers['Mcp-Session-Id'] = globalSessionId;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const res = await fetch(MCP_URL, {
|
|
37
|
+
method: 'POST',
|
|
38
|
+
headers,
|
|
39
|
+
body: JSON.stringify(request),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
// Debug: print all response headers
|
|
43
|
+
if (!globalSessionId) {
|
|
44
|
+
console.log(' Response headers:');
|
|
45
|
+
res.headers.forEach((value, key) => {
|
|
46
|
+
console.log(` ${key}: ${value}`);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Capture session ID from response headers (note: header is mcp-session-id)
|
|
51
|
+
const newSessionId = res.headers.get('mcp-session-id');
|
|
52
|
+
if (newSessionId) {
|
|
53
|
+
globalSessionId = newSessionId;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const text = await res.text();
|
|
57
|
+
|
|
58
|
+
// Parse SSE response
|
|
59
|
+
const lines = text.split('\n');
|
|
60
|
+
for (const line of lines) {
|
|
61
|
+
if (line.startsWith('data: ')) {
|
|
62
|
+
const data = line.slice(6);
|
|
63
|
+
try {
|
|
64
|
+
return JSON.parse(data);
|
|
65
|
+
} catch {}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Try direct JSON parse
|
|
70
|
+
try {
|
|
71
|
+
return JSON.parse(text);
|
|
72
|
+
} catch {
|
|
73
|
+
throw new Error(`Failed to parse response: ${text}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function main() {
|
|
78
|
+
console.log('==============================================');
|
|
79
|
+
console.log('Graphiti Model Integration Test');
|
|
80
|
+
console.log('==============================================\n');
|
|
81
|
+
|
|
82
|
+
// Initialize session
|
|
83
|
+
console.log('1. Initializing MCP session...');
|
|
84
|
+
const initResult = await makeRequest({
|
|
85
|
+
jsonrpc: '2.0',
|
|
86
|
+
id: 1,
|
|
87
|
+
method: 'initialize',
|
|
88
|
+
params: {
|
|
89
|
+
protocolVersion: '2024-11-05',
|
|
90
|
+
capabilities: {},
|
|
91
|
+
clientInfo: { name: 'model-test', version: '1.0' },
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
if (initResult.error) {
|
|
96
|
+
console.error(' โ Init failed:', initResult.error.message);
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
console.log(` โ
Session: ${globalSessionId?.slice(0, 8) || 'unknown'}...`);
|
|
101
|
+
console.log(
|
|
102
|
+
` Server: ${initResult.result.serverInfo.name} v${initResult.result.serverInfo.version}`
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
// Test add_memory
|
|
106
|
+
console.log('\n2. Testing add_memory with real Graphiti schemas...');
|
|
107
|
+
const testContent =
|
|
108
|
+
'Alice Chen is a software engineer at TechCorp in San Francisco. She collaborated with Bob Martinez on the new authentication system last week.';
|
|
109
|
+
console.log(` Input: "${testContent}"\n`);
|
|
110
|
+
|
|
111
|
+
const startTime = Date.now();
|
|
112
|
+
|
|
113
|
+
const addResult = await makeRequest({
|
|
114
|
+
jsonrpc: '2.0',
|
|
115
|
+
id: 2,
|
|
116
|
+
method: 'tools/call',
|
|
117
|
+
params: {
|
|
118
|
+
name: 'add_memory',
|
|
119
|
+
arguments: {
|
|
120
|
+
name: 'Deepseek Integration Test',
|
|
121
|
+
episode_body: testContent,
|
|
122
|
+
group_id: 'deepseek-integration-test',
|
|
123
|
+
source: 'text',
|
|
124
|
+
source_description: 'LLM model integration test',
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const duration = Date.now() - startTime;
|
|
130
|
+
|
|
131
|
+
if (addResult.error) {
|
|
132
|
+
console.error(' โ add_memory FAILED:', addResult.error.message);
|
|
133
|
+
console.log("\n This model likely has issues with Graphiti's Pydantic schemas.");
|
|
134
|
+
process.exit(1);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
console.log(` โ
add_memory SUCCEEDED (${duration}ms)`);
|
|
138
|
+
|
|
139
|
+
// Parse result content
|
|
140
|
+
const resultContent = addResult.result?.content;
|
|
141
|
+
if (resultContent && Array.isArray(resultContent)) {
|
|
142
|
+
for (const item of resultContent) {
|
|
143
|
+
if (item.type === 'text') {
|
|
144
|
+
console.log(` Result: ${item.text}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Search for created entities
|
|
150
|
+
console.log('\n3. Verifying entities were extracted...');
|
|
151
|
+
|
|
152
|
+
const searchResult = await makeRequest({
|
|
153
|
+
jsonrpc: '2.0',
|
|
154
|
+
id: 3,
|
|
155
|
+
method: 'tools/call',
|
|
156
|
+
params: {
|
|
157
|
+
name: 'search_nodes',
|
|
158
|
+
arguments: {
|
|
159
|
+
query: 'Alice Chen TechCorp',
|
|
160
|
+
group_ids: ['deepseek-integration-test'],
|
|
161
|
+
max_nodes: 10,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
if (searchResult.error) {
|
|
167
|
+
console.error(' โ ๏ธ search_nodes failed:', searchResult.error.message);
|
|
168
|
+
} else {
|
|
169
|
+
const searchContent = searchResult.result?.content;
|
|
170
|
+
if (searchContent && Array.isArray(searchContent)) {
|
|
171
|
+
for (const item of searchContent) {
|
|
172
|
+
if (item.type === 'text') {
|
|
173
|
+
try {
|
|
174
|
+
const nodes = JSON.parse(item.text);
|
|
175
|
+
console.log(` Found ${nodes.length} nodes:`);
|
|
176
|
+
for (const node of nodes.slice(0, 5)) {
|
|
177
|
+
console.log(` - ${node.name} (${node.labels?.join(', ') || 'no labels'})`);
|
|
178
|
+
}
|
|
179
|
+
} catch {
|
|
180
|
+
console.log(` Result: ${item.text.slice(0, 200)}...`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// Cleanup
|
|
188
|
+
console.log('\n4. Cleaning up test data...');
|
|
189
|
+
|
|
190
|
+
const clearResult = await makeRequest({
|
|
191
|
+
jsonrpc: '2.0',
|
|
192
|
+
id: 4,
|
|
193
|
+
method: 'tools/call',
|
|
194
|
+
params: {
|
|
195
|
+
name: 'clear_graph',
|
|
196
|
+
arguments: {
|
|
197
|
+
group_ids: ['deepseek-integration-test'],
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
});
|
|
201
|
+
|
|
202
|
+
if (clearResult.error) {
|
|
203
|
+
console.error(' โ ๏ธ Cleanup failed:', clearResult.error.message);
|
|
204
|
+
} else {
|
|
205
|
+
console.log(' โ
Test data cleared');
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
console.log('\n==============================================');
|
|
209
|
+
console.log('TEST PASSED - Model works with Graphiti');
|
|
210
|
+
console.log(`Total time: ${duration}ms`);
|
|
211
|
+
console.log('==============================================');
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
main().catch((err) => {
|
|
215
|
+
console.error('Test failed:', err.message);
|
|
216
|
+
process.exit(1);
|
|
217
|
+
});
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
const OPENROUTER_API_KEY = process.env.OPENROUTER_API_KEY;
|
|
3
|
+
|
|
4
|
+
const GROK_MODELS = [
|
|
5
|
+
{ id: 'x-ai/grok-4.1-fast', name: 'Grok 4.1 Fast', inputPrice: 0.2, outputPrice: 0.5 },
|
|
6
|
+
{ id: 'x-ai/grok-4-fast', name: 'Grok 4 Fast', inputPrice: 0.2, outputPrice: 0.5 },
|
|
7
|
+
{ id: 'x-ai/grok-4', name: 'Grok 4', inputPrice: 3.0, outputPrice: 15.0 },
|
|
8
|
+
{ id: 'x-ai/grok-3-mini', name: 'Grok 3 Mini', inputPrice: 0.3, outputPrice: 0.5 },
|
|
9
|
+
{ id: 'x-ai/grok-3', name: 'Grok 3', inputPrice: 3.0, outputPrice: 15.0 },
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
const TEST_CASES = [
|
|
13
|
+
{
|
|
14
|
+
name: 'Basic',
|
|
15
|
+
text: 'John Smith works at Acme Corp in New York. He met Sarah Jones yesterday.',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'Technical',
|
|
19
|
+
text: 'The PAI system uses Neo4j for graph storage. It was created by Daniel Miessler.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'Complex',
|
|
23
|
+
text: 'Alice, the CTO of TechStart, acquired DataFlow Inc. Bob now reports to Alice.',
|
|
24
|
+
},
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
const PROMPT = (text: string) => `Extract entities and relationships. Return ONLY valid JSON.
|
|
28
|
+
Text: "${text}"
|
|
29
|
+
Format: {"entities": [{"name": "string", "type": "PERSON|ORG|LOCATION"}], "relationships": [{"source": "string", "target": "string", "type": "string"}]}`;
|
|
30
|
+
|
|
31
|
+
function extractJSON(text: string): any {
|
|
32
|
+
const clean = text
|
|
33
|
+
.replace(/```json\n?/g, '')
|
|
34
|
+
.replace(/```\n?/g, '')
|
|
35
|
+
.trim();
|
|
36
|
+
try {
|
|
37
|
+
const obj = JSON.parse(clean);
|
|
38
|
+
if (obj.entities) return obj;
|
|
39
|
+
} catch {}
|
|
40
|
+
const match = clean.match(/\{[\s\S]*"entities"[\s\S]*\}/);
|
|
41
|
+
if (match)
|
|
42
|
+
try {
|
|
43
|
+
return JSON.parse(match[0]);
|
|
44
|
+
} catch {}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async function testModel(model: (typeof GROK_MODELS)[0]) {
|
|
49
|
+
console.log(`\n๐ ${model.name} (${model.id})`);
|
|
50
|
+
let passed = 0;
|
|
51
|
+
let totalMs = 0;
|
|
52
|
+
let totalIn = 0;
|
|
53
|
+
let totalOut = 0;
|
|
54
|
+
|
|
55
|
+
for (const test of TEST_CASES) {
|
|
56
|
+
const start = Date.now();
|
|
57
|
+
try {
|
|
58
|
+
const res = await fetch('https://openrouter.ai/api/v1/chat/completions', {
|
|
59
|
+
method: 'POST',
|
|
60
|
+
headers: {
|
|
61
|
+
Authorization: `Bearer ${OPENROUTER_API_KEY}`,
|
|
62
|
+
'Content-Type': 'application/json',
|
|
63
|
+
},
|
|
64
|
+
body: JSON.stringify({
|
|
65
|
+
model: model.id,
|
|
66
|
+
messages: [{ role: 'user', content: PROMPT(test.text) }],
|
|
67
|
+
temperature: 0.1,
|
|
68
|
+
max_tokens: 500,
|
|
69
|
+
}),
|
|
70
|
+
});
|
|
71
|
+
const ms = Date.now() - start;
|
|
72
|
+
totalMs += ms;
|
|
73
|
+
if (!res.ok) {
|
|
74
|
+
console.log(` โ ${test.name}: HTTP ${res.status}`);
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const data = (await res.json()) as any;
|
|
78
|
+
totalIn += data.usage?.prompt_tokens || 0;
|
|
79
|
+
totalOut += data.usage?.completion_tokens || 0;
|
|
80
|
+
const json = extractJSON(data.choices?.[0]?.message?.content || '');
|
|
81
|
+
if (json) {
|
|
82
|
+
console.log(` โ
${test.name}: ${json.entities?.length || 0} entities (${ms}ms)`);
|
|
83
|
+
passed++;
|
|
84
|
+
} else {
|
|
85
|
+
console.log(` โ ${test.name}: Invalid JSON`);
|
|
86
|
+
}
|
|
87
|
+
} catch (e: any) {
|
|
88
|
+
console.log(` โ ${test.name}: ${e.message}`);
|
|
89
|
+
}
|
|
90
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const avgIn = totalIn / TEST_CASES.length;
|
|
94
|
+
const avgOut = totalOut / TEST_CASES.length;
|
|
95
|
+
const cost = ((avgIn / 1e6) * model.inputPrice + (avgOut / 1e6) * model.outputPrice) * 1000;
|
|
96
|
+
return {
|
|
97
|
+
name: model.name,
|
|
98
|
+
passRate: (passed / TEST_CASES.length) * 100,
|
|
99
|
+
avgMs: Math.round(totalMs / TEST_CASES.length),
|
|
100
|
+
cost,
|
|
101
|
+
inputPrice: model.inputPrice,
|
|
102
|
+
outputPrice: model.outputPrice,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async function main() {
|
|
107
|
+
console.log('โ'.repeat(60));
|
|
108
|
+
console.log('๐งช Grok Models Test (Correct IDs)');
|
|
109
|
+
console.log('โ'.repeat(60));
|
|
110
|
+
|
|
111
|
+
const results = [];
|
|
112
|
+
for (const m of GROK_MODELS) {
|
|
113
|
+
results.push(await testModel(m));
|
|
114
|
+
await new Promise((r) => setTimeout(r, 1000));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
console.log(`\n${'โ'.repeat(90)}`);
|
|
118
|
+
console.log('๐ GROK MODELS COMPARISON');
|
|
119
|
+
console.log(`${'โ'.repeat(90)}\n`);
|
|
120
|
+
console.log(
|
|
121
|
+
'| Model | Pass Rate | Avg Time | Input $/M | Output $/M | Cost/1K Calls |'
|
|
122
|
+
);
|
|
123
|
+
console.log(
|
|
124
|
+
'|------------------|-----------|----------|-----------|------------|---------------|'
|
|
125
|
+
);
|
|
126
|
+
for (const r of results) {
|
|
127
|
+
if (r.passRate > 0)
|
|
128
|
+
console.log(
|
|
129
|
+
`| ${r.name.padEnd(16)} | ${r.passRate.toFixed(0).padStart(7)}% | ${(`${r.avgMs}ms`).padStart(8)} | $${r.inputPrice.toFixed(2).padStart(7)} | $${r.outputPrice.toFixed(2).padStart(8)} | $${r.cost.toFixed(4).padStart(11)} |`
|
|
130
|
+
);
|
|
131
|
+
else
|
|
132
|
+
console.log(
|
|
133
|
+
`| ${r.name.padEnd(16)} | FAILED | - | - | - | - |`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
await Bun.write(
|
|
137
|
+
'grok-results.json',
|
|
138
|
+
JSON.stringify({ results, timestamp: new Date().toISOString() }, null, 2)
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
main();
|