added pnpm

This commit is contained in:
Deepak
2024-12-27 15:12:27 +05:30
parent 954e49e08e
commit ab9259d4e2
11 changed files with 206 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
import { ChatOpenAI } from "@langchain/openai";
import "dotenv/config";
export const gpt4o = new ChatOpenAI({
modelName: "gpt-4o",
apiKey: process.env.OPENAI_API_KEY!,
});
export const gpt4oMini = new ChatOpenAI({
modelName: "gpt-4o-mini",
apiKey: process.env.OPENAI_API_KEY!,
});

View File

@@ -0,0 +1,7 @@
import { SolanaAgentKit } from "solana-agent-kit";
export const agentKit = new SolanaAgentKit(
process.env.SOLANA_PRIVATE_KEY!,
process.env.RPC_URL!,
process.env.OPENAI_API_KEY!,
);

View File

@@ -0,0 +1,25 @@
import { Annotation } from "@langchain/langgraph";
import { BaseMessage } from "@langchain/core/messages";
import { messagesStateReducer } from "@langchain/langgraph";
export const solanaAgentState = Annotation.Root({
messages: Annotation<BaseMessage[]>({
reducer: messagesStateReducer,
default: () => [],
}),
isSolanaReadQuery: Annotation<boolean>({
reducer: (x, y) => y ?? x ?? false,
default: () => false,
}),
isSolanaWriteQuery: Annotation<boolean>({
reducer: (x, y) => y ?? x ?? false,
default: () => false,
}),
isGeneralQuery: Annotation<boolean>({
reducer: (x, y) => y ?? x ?? false,
default: () => false,
}),
});