Skip to content
Merged
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ⎇ Model Mux

[![npm version](https://img.shields.io/npm/v/model-mux?logo=npm)](https://www.npmjs.com/package/model-mux)
[![npm downloads](https://img.shields.io/npm/dt/model-mux)](https://www.npmjs.com/package/model-mux)
[![pipeline](https://github.com/The-Nefarious-Developer/model-mux/actions/workflows/main.yaml/badge.svg)](https://github.com/The-Nefarious-Developer/model-mux/actions/workflows/main.yaml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](https://github.com/semantic-release/semantic-release)
Expand Down
1 change: 1 addition & 0 deletions examples/my-agent/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
API_KEY_OPENAI=<placeholder_for_openai_api_key>
33 changes: 33 additions & 0 deletions examples/my-agent/agent.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { FunctionTool, LlmAgent } from '@google/adk';
import dotenv from 'dotenv';
import { ModelMux } from 'model-mux';
import { z } from 'zod';

dotenv.config();

/* Mock tool implementation */
const getCurrentTime = new FunctionTool({
name: 'get_current_time',
description: 'Returns the current time in a specified city.',
parameters: z.object({
city: z.string().describe('The name of the city for which to retrieve the current time.'),
}),
execute: ({ city }) => {
return { status: 'success', report: `The current time in ${city} is 10:30 AM` };
},
});

const modelMux = new ModelMux({
model: 'gpt-5.4-2026-03-05',
baseUrl: 'https://api.openai.com/v1',
apiKey: process.env.API_KEY_OPENAI,
});

export const rootAgent = new LlmAgent({
name: 'hello_time_agent',
model: modelMux,
description: 'Tells the current time in a specified city.',
instruction: `You are a helpful assistant that tells the current time in a city.
Use the 'getCurrentTime' tool for this purpose.`,
tools: [getCurrentTime],
});
23 changes: 23 additions & 0 deletions examples/my-agent/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "my-agent",
"version": "1.0.0",
"description": "",
"main": "agent.ts",
"scripts": {
"inspect:cli": "npx adk run agent.ts",
"inspect:web": "npx adk web"
},
"keywords": [],
"author": "",
"license": "ISC",
"type": "module",
"dependencies": {
"@google/adk": "^0.5.0",
"dotenv": "^17.3.1",
"model-mux": "^1.0.4",
"zod": "^4.3.6"
},
"devDependencies": {
"@google/adk-devtools": "^0.5.0"
}
}
Loading
Loading