v0.6.1 - reinstated UI, relay > cortex pipeline working
This commit is contained in:
@@ -151,6 +151,25 @@ app.post("/chat", async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// -----------------------------------------------------
|
||||
// SESSION ENDPOINTS (for UI)
|
||||
// -----------------------------------------------------
|
||||
// In-memory session storage (could be replaced with a database)
|
||||
const sessions = new Map();
|
||||
|
||||
app.get("/sessions/:id", (req, res) => {
|
||||
const sessionId = req.params.id;
|
||||
const history = sessions.get(sessionId) || [];
|
||||
res.json(history);
|
||||
});
|
||||
|
||||
app.post("/sessions/:id", (req, res) => {
|
||||
const sessionId = req.params.id;
|
||||
const history = req.body;
|
||||
sessions.set(sessionId, history);
|
||||
res.json({ ok: true, saved: history.length });
|
||||
});
|
||||
|
||||
// -----------------------------------------------------
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Relay is online on port ${PORT}`);
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const RELAY_BASE = "http://10.0.0.40:7078";
|
||||
const RELAY_BASE = "http://10.0.0.41:7078";
|
||||
const API_URL = `${RELAY_BASE}/v1/chat/completions`;
|
||||
|
||||
function generateSessionId() {
|
||||
|
||||
Reference in New Issue
Block a user