diff --git a/examples/twitter-example/twitter.ts b/examples/twitter-example/twitter.ts index 91dbf3e0..93087449 100644 --- a/examples/twitter-example/twitter.ts +++ b/examples/twitter-example/twitter.ts @@ -6,11 +6,11 @@ import { GameWorker, LLMModel, } from "@virtuals-protocol/game"; -import dotenv from 'dotenv'; -import path from 'path'; +import dotenv from "dotenv"; +import path from "path"; // Load environment variables from the correct location -dotenv.config({ path: path.join(__dirname, '.env') }); +dotenv.config({ path: path.join(__dirname, ".env") }); const postTweetFunction = new GameFunction({ name: "post_tweet", @@ -114,7 +114,7 @@ const agent = new GameAgent(process.env.API_KEY!, { goal: "Search and reply to tweets", description: "A bot that searches for tweets and replies to them", workers: [postTweetWorker], - llmModel: LLMModel.DeepSeek_R1, // Optional: Set the LLM model default (LLMModel.Llama_3_1_405B_Instruct) + llmModel: LLMModel.Llama_3_1_405B_Instruct, // Optional: Set the LLM model default (LLMModel.Llama_3_1_405B_Instruct) // Optional: Get the agent state getAgentState: async () => { return { diff --git a/game-starter/src/agent.ts b/game-starter/src/agent.ts index 1ce8abac..fbeeca60 100644 --- a/game-starter/src/agent.ts +++ b/game-starter/src/agent.ts @@ -4,19 +4,20 @@ import dotenv from "dotenv"; dotenv.config(); if (!process.env.API_KEY) { - throw new Error('API_KEY is required in environment variables'); + throw new Error("API_KEY is required in environment variables"); } export const activity_agent = new GameAgent(process.env.API_KEY, { - name: "Activity Recommender", - goal: "Help users find the perfect activities based on their location and current weather conditions", - description: "You are an agent that gets location of the user and then uses that to get weather information and then uses that to recommend activities", - workers: [activityRecommenderWorker], - llmModel: LLMModel.DeepSeek_R1 // this is an optional paramenter to set the llm model for the agent. Default is Llama_3_1_405B_Instruct + name: "Activity Recommender", + goal: "Help users find the perfect activities based on their location and current weather conditions", + description: + "You are an agent that gets location of the user and then uses that to get weather information and then uses that to recommend activities", + workers: [activityRecommenderWorker], + llmModel: LLMModel.Llama_3_1_405B_Instruct, // this is an optional paramenter to set the llm model for the agent. Default is Llama_3_1_405B_Instruct }); activity_agent.setLogger((agent: GameAgent, msg: string) => { - console.log(`🎯 [${agent.name}]`); - console.log(msg); - console.log("------------------------\n"); -}); \ No newline at end of file + console.log(`🎯 [${agent.name}]`); + console.log(msg); + console.log("------------------------\n"); +}); diff --git a/src/interface/GameClient.ts b/src/interface/GameClient.ts index ff0e06d4..147a2c24 100644 --- a/src/interface/GameClient.ts +++ b/src/interface/GameClient.ts @@ -41,8 +41,6 @@ export interface GameAction { export enum LLMModel { Llama_3_1_405B_Instruct = "Llama-3.1-405B-Instruct", Llama_3_3_70B_Instruct = "Llama-3.3-70B-Instruct", - DeepSeek_R1 = "DeepSeek-R1", - DeepSeek_V3 = "DeepSeek-V3", Qwen_2_5_72B_Instruct = "Qwen-2.5-72B-Instruct", } diff --git a/tools/cloud-to-sdk/generateAgent.ts b/tools/cloud-to-sdk/generateAgent.ts index fa4fe717..09e9bec0 100644 --- a/tools/cloud-to-sdk/generateAgent.ts +++ b/tools/cloud-to-sdk/generateAgent.ts @@ -1,43 +1,43 @@ // generateAgent.ts -import fs from 'fs'; -import path from 'path'; -import { PluginJson } from './types'; +import fs from "fs"; +import path from "path"; +import { PluginJson } from "./types"; import { GameAgent, LLMModel } from "@virtuals-protocol/game"; export function generateAgent(json: PluginJson, outputPath: string): void { - try { - // Ensure directory exists - const dir = path.dirname(outputPath); - if (!fs.existsSync(dir)) { - fs.mkdirSync(dir, { recursive: true }); - } + try { + // Ensure directory exists + const dir = path.dirname(outputPath); + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir, { recursive: true }); + } - const modelMapping: { [key: string]: string } = { - 'llama_3_1_405b': 'Llama_3_1_405B_Instruct', - 'llama_3_3_70b': 'Llama_3_3_70B_Instruct', - 'deepseek_r1': 'DeepSeek_R1', - 'deepseek_v3': 'DeepSeek_V3', - 'qwen_2_5_72b': 'Qwen_2_5_72B_Instruct' - }; + const modelMapping: { [key: string]: string } = { + llama_3_1_405b: "Llama_3_1_405B_Instruct", + llama_3_3_70b: "Llama_3_3_70B_Instruct", + qwen_2_5_72b: "Qwen_2_5_72B_Instruct", + }; - const modelName = modelMapping[json.gameEngineModel.toLowerCase()] || 'Llama_3_3_70B_Instruct'; + const modelName = + modelMapping[json.gameEngineModel.toLowerCase()] || + "Llama_3_3_70B_Instruct"; - const content = ` + const content = ` import { GameAgent, LLMModel } from "@virtuals-protocol/game"; import { workers } from "./worker"; export const agent = new GameAgent("YOUR_API_KEY", { - name: "${json.name || 'name'}", + name: "${json.name || "name"}", goal: \`${json.goal}\`, description: \`${json.description}\`, workers: workers, llmModel: LLMModel.${modelName} });`; - fs.writeFileSync(outputPath, content); - console.log(`✅ Generated agent.ts at ${outputPath}`); - } catch (error) { - console.error(`❌ Error generating agent.ts:`, error); - throw error; - } -} \ No newline at end of file + fs.writeFileSync(outputPath, content); + console.log(`✅ Generated agent.ts at ${outputPath}`); + } catch (error) { + console.error(`❌ Error generating agent.ts:`, error); + throw error; + } +}