architectgbt-mcp 0.2.1 ā 0.2.2
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.
|
@@ -108,28 +108,87 @@ export async function handleGetRecommendation(args) {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
function formatRecommendation(data) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
-
if (model.context_window) {
|
|
121
|
-
result += `- **Context Window:** ${model.context_window.toLocaleString()} tokens\n`;
|
|
111
|
+
// Handle conversational/off-topic responses
|
|
112
|
+
if (data.off_topic || data.needs_clarification) {
|
|
113
|
+
let result = data.message || '';
|
|
114
|
+
if (data.questions && Array.isArray(data.questions) && data.questions.length > 0) {
|
|
115
|
+
result += `\n\nš To help me recommend the perfect AI model, please tell me:\n`;
|
|
116
|
+
data.questions.forEach((q, i) => {
|
|
117
|
+
result += `${i + 1}. ${q}\n`;
|
|
118
|
+
});
|
|
122
119
|
}
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
const recommendations = data.recommendations || [];
|
|
123
|
+
if (recommendations.length === 0) {
|
|
124
|
+
return `ā No recommendations found. Try describing your project in more detail.`;
|
|
125
|
+
}
|
|
126
|
+
let result = `šÆ AI Model Recommendation ā Analysis Complete!\n`;
|
|
127
|
+
result += `${"=".repeat(70)}\n\n`;
|
|
128
|
+
// Main recommendation
|
|
129
|
+
const top = recommendations[0];
|
|
130
|
+
result += `⨠TOP MATCH (${top.match_score || top.score || 95}% match)\n\n`;
|
|
131
|
+
result += `${top.model_name || top.name}\n`;
|
|
132
|
+
result += `Provider: ${top.provider}\n`;
|
|
133
|
+
// Pricing
|
|
134
|
+
if (top.estimated_cost) {
|
|
135
|
+
const cost = top.estimated_cost;
|
|
136
|
+
result += `Estimated Cost: $${cost.total_cost_usd?.toFixed(4) || '0.0000'}\n`;
|
|
137
|
+
result += ` āā ${cost.input_tokens?.toLocaleString() || '0'} input + ${cost.output_tokens?.toLocaleString() || '0'} output tokens\n`;
|
|
138
|
+
}
|
|
139
|
+
else if (top.input_price !== undefined && top.output_price !== undefined) {
|
|
140
|
+
result += `Pricing: $${top.input_price}/1M input ⢠$${top.output_price}/1M output\n`;
|
|
141
|
+
}
|
|
142
|
+
// Capabilities
|
|
143
|
+
if (top.capabilities?.context_window || top.context_window) {
|
|
144
|
+
const contextWindow = top.capabilities?.context_window || top.context_window;
|
|
145
|
+
result += `Context Window: ${contextWindow.toLocaleString()} tokens\n`;
|
|
146
|
+
}
|
|
147
|
+
// Reasoning
|
|
148
|
+
if (top.reasoning) {
|
|
149
|
+
result += `\nš” Why this model?\n${top.reasoning}\n`;
|
|
123
150
|
}
|
|
124
|
-
|
|
125
|
-
|
|
151
|
+
// Pros and Cons
|
|
152
|
+
if (top.pros || top.cons) {
|
|
153
|
+
result += `\n`;
|
|
154
|
+
if (top.pros && top.pros.length > 0) {
|
|
155
|
+
result += `ā
Pros:\n`;
|
|
156
|
+
top.pros.forEach((pro) => {
|
|
157
|
+
result += ` ⢠${pro}\n`;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
if (top.cons && top.cons.length > 0) {
|
|
161
|
+
result += `ā ļø Cons:\n`;
|
|
162
|
+
top.cons.forEach((con) => {
|
|
163
|
+
result += ` ⢠${con}\n`;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
126
166
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
167
|
+
// Alternative recommendations
|
|
168
|
+
if (recommendations.length > 1) {
|
|
169
|
+
result += `\n${"ā".repeat(70)}\n`;
|
|
170
|
+
result += `\nAlternative Options:\n\n`;
|
|
171
|
+
recommendations.slice(1, 3).forEach((rec, i) => {
|
|
172
|
+
result += `${i + 2}. ${rec.model_name || rec.name} (${rec.match_score || rec.score || '??'}% match)\n`;
|
|
173
|
+
result += ` Provider: ${rec.provider}\n`;
|
|
174
|
+
if (rec.estimated_cost) {
|
|
175
|
+
result += ` Cost: $${rec.estimated_cost.total_cost_usd?.toFixed(4) || '0.0000'}\n`;
|
|
176
|
+
}
|
|
177
|
+
else if (rec.input_price !== undefined) {
|
|
178
|
+
result += ` Pricing: $${rec.input_price}/1M in ⢠$${rec.output_price}/1M out\n`;
|
|
179
|
+
}
|
|
180
|
+
if (rec.reasoning) {
|
|
181
|
+
result += ` Reason: ${rec.reasoning.substring(0, 150)}${rec.reasoning.length > 150 ? '...' : ''}\n`;
|
|
182
|
+
}
|
|
183
|
+
result += `\n`;
|
|
131
184
|
});
|
|
132
185
|
}
|
|
133
|
-
|
|
186
|
+
// Analysis summary
|
|
187
|
+
if (data.analysis_summary) {
|
|
188
|
+
result += `${"ā".repeat(70)}\n`;
|
|
189
|
+
result += `\nš Analysis Summary:\n${data.analysis_summary}\n\n`;
|
|
190
|
+
}
|
|
191
|
+
result += `${"=".repeat(70)}\n`;
|
|
192
|
+
result += `š Powered by ArchitectGBT ⢠https://architectgbt.com`;
|
|
134
193
|
return result;
|
|
135
194
|
}
|
package/package.json
CHANGED
|
@@ -126,36 +126,100 @@ export async function handleGetRecommendation(args: unknown) {
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
function formatRecommendation(data: any): string {
|
|
129
|
-
|
|
129
|
+
// Handle conversational/off-topic responses
|
|
130
|
+
if (data.off_topic || data.needs_clarification) {
|
|
131
|
+
let result = data.message || '';
|
|
132
|
+
|
|
133
|
+
if (data.questions && Array.isArray(data.questions) && data.questions.length > 0) {
|
|
134
|
+
result += `\n\nš To help me recommend the perfect AI model, please tell me:\n`;
|
|
135
|
+
data.questions.forEach((q: string, i: number) => {
|
|
136
|
+
result += `${i + 1}. ${q}\n`;
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
130
142
|
|
|
131
|
-
|
|
143
|
+
const recommendations = data.recommendations || [];
|
|
144
|
+
|
|
145
|
+
if (recommendations.length === 0) {
|
|
146
|
+
return `ā No recommendations found. Try describing your project in more detail.`;
|
|
147
|
+
}
|
|
132
148
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
149
|
+
let result = `šÆ AI Model Recommendation ā Analysis Complete!\n`;
|
|
150
|
+
result += `${"=".repeat(70)}\n\n`;
|
|
151
|
+
|
|
152
|
+
// Main recommendation
|
|
153
|
+
const top = recommendations[0];
|
|
154
|
+
result += `⨠TOP MATCH (${top.match_score || top.score || 95}% match)\n\n`;
|
|
155
|
+
result += `${top.model_name || top.name}\n`;
|
|
156
|
+
result += `Provider: ${top.provider}\n`;
|
|
157
|
+
|
|
158
|
+
// Pricing
|
|
159
|
+
if (top.estimated_cost) {
|
|
160
|
+
const cost = top.estimated_cost;
|
|
161
|
+
result += `Estimated Cost: $${cost.total_cost_usd?.toFixed(4) || '0.0000'}\n`;
|
|
162
|
+
result += ` āā ${cost.input_tokens?.toLocaleString() || '0'} input + ${cost.output_tokens?.toLocaleString() || '0'} output tokens\n`;
|
|
163
|
+
} else if (top.input_price !== undefined && top.output_price !== undefined) {
|
|
164
|
+
result += `Pricing: $${top.input_price}/1M input ⢠$${top.output_price}/1M output\n`;
|
|
165
|
+
}
|
|
137
166
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
167
|
+
// Capabilities
|
|
168
|
+
if (top.capabilities?.context_window || top.context_window) {
|
|
169
|
+
const contextWindow = top.capabilities?.context_window || top.context_window;
|
|
170
|
+
result += `Context Window: ${contextWindow.toLocaleString()} tokens\n`;
|
|
171
|
+
}
|
|
141
172
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
173
|
+
// Reasoning
|
|
174
|
+
if (top.reasoning) {
|
|
175
|
+
result += `\nš” Why this model?\n${top.reasoning}\n`;
|
|
145
176
|
}
|
|
146
177
|
|
|
147
|
-
|
|
148
|
-
|
|
178
|
+
// Pros and Cons
|
|
179
|
+
if (top.pros || top.cons) {
|
|
180
|
+
result += `\n`;
|
|
181
|
+
if (top.pros && top.pros.length > 0) {
|
|
182
|
+
result += `ā
Pros:\n`;
|
|
183
|
+
top.pros.forEach((pro: string) => {
|
|
184
|
+
result += ` ⢠${pro}\n`;
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
if (top.cons && top.cons.length > 0) {
|
|
188
|
+
result += `ā ļø Cons:\n`;
|
|
189
|
+
top.cons.forEach((con: string) => {
|
|
190
|
+
result += ` ⢠${con}\n`;
|
|
191
|
+
});
|
|
192
|
+
}
|
|
149
193
|
}
|
|
150
194
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
195
|
+
// Alternative recommendations
|
|
196
|
+
if (recommendations.length > 1) {
|
|
197
|
+
result += `\n${"ā".repeat(70)}\n`;
|
|
198
|
+
result += `\nAlternative Options:\n\n`;
|
|
199
|
+
|
|
200
|
+
recommendations.slice(1, 3).forEach((rec: any, i: number) => {
|
|
201
|
+
result += `${i + 2}. ${rec.model_name || rec.name} (${rec.match_score || rec.score || '??'}% match)\n`;
|
|
202
|
+
result += ` Provider: ${rec.provider}\n`;
|
|
203
|
+
if (rec.estimated_cost) {
|
|
204
|
+
result += ` Cost: $${rec.estimated_cost.total_cost_usd?.toFixed(4) || '0.0000'}\n`;
|
|
205
|
+
} else if (rec.input_price !== undefined) {
|
|
206
|
+
result += ` Pricing: $${rec.input_price}/1M in ⢠$${rec.output_price}/1M out\n`;
|
|
207
|
+
}
|
|
208
|
+
if (rec.reasoning) {
|
|
209
|
+
result += ` Reason: ${rec.reasoning.substring(0, 150)}${rec.reasoning.length > 150 ? '...' : ''}\n`;
|
|
210
|
+
}
|
|
211
|
+
result += `\n`;
|
|
155
212
|
});
|
|
156
213
|
}
|
|
157
214
|
|
|
158
|
-
|
|
215
|
+
// Analysis summary
|
|
216
|
+
if (data.analysis_summary) {
|
|
217
|
+
result += `${"ā".repeat(70)}\n`;
|
|
218
|
+
result += `\nš Analysis Summary:\n${data.analysis_summary}\n\n`;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
result += `${"=".repeat(70)}\n`;
|
|
222
|
+
result += `š Powered by ArchitectGBT ⢠https://architectgbt.com`;
|
|
159
223
|
|
|
160
224
|
return result;
|
|
161
225
|
}
|