Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions libs/providers/baseten/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"name": "@langchain/baseten",
"version": "1.0.0-alpha.0",
"description": "Baseten LLM provider for LangChain and deepagents",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"type": "module",
"scripts": {
"build": "tsdown",
"clean": "rm -rf dist/ .tsdown/",
"dev": "tsc --watch",
"typecheck": "tsc --noEmit",
"prepublishOnly": "pnpm build",
"test": "vitest run",
"test:unit": "vitest run",
"test:int": "vitest run --mode int"
},
"repository": {
"type": "git",
"url": "git+https://github.com/langchain-ai/deepagentsjs.git"
},
"keywords": [
"ai",
"agents",
"langgraph",
"langchain",
"typescript",
"llm",
"baseten",
"chat-model"
],
"author": "LangChain",
"license": "MIT",
"bugs": {
"url": "https://github.com/langchain-ai/deepagentsjs/issues"
},
"homepage": "https://github.com/langchain-ai/deepagentsjs#readme",
"dependencies": {
"@langchain/openai": "^1.4.1"
},
"peerDependencies": {
"@langchain/core": "^1.1.38"
},
"devDependencies": {
"deepagents": "workspace:*",
"@langchain/core": "^1.1.38",
"@tsconfig/recommended": "^1.0.13",
"@types/node": "^25.1.0",
"@vitest/coverage-v8": "^4.0.18",
"dotenv": "^17.2.3",
"tsdown": "^0.21.4",
"tsx": "^4.21.0",
"typescript": "^6.0.2",
"vitest": "^4.0.18"
},
"exports": {
".": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./package.json": "./package.json"
},
"files": [
"dist/**/*"
]
}
65 changes: 65 additions & 0 deletions libs/providers/baseten/src/baseten.int.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { describe, it, expect } from "vitest";
import { HumanMessage } from "@langchain/core/messages";
import { ChatBaseten } from "./baseten.js";
import { createDeepAgent } from "deepagents";

const BASETEN_MODEL = "deepseek-ai/DeepSeek-V3.1";

describe("ChatBaseten Integration Tests", () => {
it(
"should invoke ChatBaseten directly",
{ timeout: 60_000 },
async () => {
const model = new ChatBaseten({ model: BASETEN_MODEL });

const result = await model.invoke([
new HumanMessage("What is 2 + 2? Answer with just the number."),
]);

expect(result.content).toBeTruthy();
expect(typeof result.content).toBe("string");
expect(result.content).toContain("4");
},
);

it(
"should stream responses from ChatBaseten",
{ timeout: 60_000 },
async () => {
const model = new ChatBaseten({ model: BASETEN_MODEL });

const chunks: string[] = [];
for await (const chunk of await model.stream(
"Say the word 'hello' and nothing else.",
)) {
if (typeof chunk.content === "string") {
chunks.push(chunk.content);
}
}

const fullResponse = chunks.join("");
expect(fullResponse.toLowerCase()).toContain("hello");
},
);

it(
"should work with createDeepAgent",
{ timeout: 90_000 },
async () => {
const model = new ChatBaseten({ model: BASETEN_MODEL });

const agent = createDeepAgent({ model });

const result = await agent.invoke({
messages: [
new HumanMessage(
"What is the capital of France? Answer in one word.",
),
],
});

const lastMessage = result.messages[result.messages.length - 1];
expect(lastMessage.content).toBeTruthy();
},
);
});
Loading
Loading