convesation-layer-agent establecido
This commit is contained in:
@@ -6,6 +6,7 @@ dotenv.config();
|
||||
|
||||
const PORT = Number(process.env.PORT) || 8001;
|
||||
const API_KEY = process.env.GEMINI_API_KEY || '';
|
||||
console.log(`Using Gemini API key: ${API_KEY}`);
|
||||
|
||||
const genAI = API_KEY ? new GoogleGenerativeAI(API_KEY) : null;
|
||||
const model = genAI ? genAI.getGenerativeModel({ model: 'gemini-pro' }) : null;
|
||||
@@ -38,6 +39,19 @@ app.post('/', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.send(`
|
||||
<h1>Conversation Layer Agent</h1>
|
||||
<p>This service answers questions about the repository.</p>
|
||||
<p>Send a POST request to / with a JSON body containing {"message": "your question"}</p>
|
||||
<p>Example: {"message": "What is this repository about?"}</p>
|
||||
<p>It will respond with a JSON object containing {"reply": "the answer"}</p>
|
||||
|
||||
<p>Repository info: ${repoInfo}</p>
|
||||
`);
|
||||
}
|
||||
);
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`conversation-layer-agent listening on ${PORT}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user