-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathAiServices.js
More file actions
28 lines (26 loc) · 798 Bytes
/
AiServices.js
File metadata and controls
28 lines (26 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
class AIService {
constructor(apiKey) {
this.apiKey = apiKey;
this.models = {
analysis: "anthropic/claude-2",
sentiment: "openai/gpt-4",
technical: "anthropic/claude-2"
};
}
async getTokenAnalysis(tokenData) {
try {
const response = await this.makeAIRequest({
model: this.models.analysis,
prompt: this.buildAnalysisPrompt(tokenData),
temperature: 0.7
});
return this.parseAIResponse(response);
} catch (error) {
console.error('AI Analysis Error:', error);
return this.getFallbackAnalysis(tokenData);
}
}
buildAnalysisPrompt(tokenData) {
// Enhanced prompt engineering
}
}