Skip to content

Commit

Permalink
adjust endpoints and update dependenceis
Browse files Browse the repository at this point in the history
  • Loading branch information
tomfrenken committed Oct 4, 2024
1 parent 540bfc5 commit 590f022
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sample-code/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ app.get('/ai-api/get-deployments', async (req, res) => {
}
});

app.get('/langchain/chat', async (req, res) => {
app.get('/langchain/invoke', async (req, res) => {
try {
res.send(await invoke());
} catch (error: any) {
Expand All @@ -108,7 +108,7 @@ app.get('/langchain/chat', async (req, res) => {
}
});

app.get('/langchain/complex-chat', async (req, res) => {
app.get('/langchain/invoke-chain', async (req, res) => {
try {
res.send(await invokeChain());
} catch (error: any) {
Expand All @@ -119,7 +119,7 @@ app.get('/langchain/complex-chat', async (req, res) => {
}
});

app.get('/langchain/retrieval-augmented-generation', async (req, res) => {
app.get('/langchain/invoke-rag-chain', async (req, res) => {
try {
res.send(await invokeRagChain());
} catch (error: any) {
Expand Down
3 changes: 3 additions & 0 deletions tests/smoke-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@
"node": "^20"
},
"dependencies": {
"langchain": "0.3.2",
"@langchain/core": "0.3.7",
"@langchain/textsplitters": "0.1.0",
"@sap-ai-sdk/ai-api": "canary",
"@sap-ai-sdk/foundation-models": "canary",
"@sap-ai-sdk/langchain": "canary",
"@sap-ai-sdk/orchestration": "canary",
"@sap-cloud-sdk/util": "^3.21.0",
"express": "^4.21.0"
},
"devDependencies": {
Expand Down
6 changes: 6 additions & 0 deletions tests/smoke-tests/test/smoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ describe('Smoke Test', () => {
fetch(`${smokeTestRoute}/orchestration/simple`)
).resolves.toHaveProperty('status', 200);
});

it('langchain client retrieves completion results', async () => {
await expect(
fetch(`${smokeTestRoute}/langchain/invoke`)
).resolves.toHaveProperty('status', 200);
});
});

0 comments on commit 590f022

Please sign in to comment.