@ebowwa/teammates-glm
v0.1.0
Published
GLM 4.7 provider plugin for @ebowwa/teammates
Maintainers
Readme
@ebowwa/teammates-glm
GLM 4.7 provider plugin for @ebowwa/teammates. Enables multi-agent coordination using GLM models.
Features
- GLM Integration: Uses existing
@ebowwa/aiGLM client - Composable: Plugin architecture - no changes to core teammates package
- Model Selection: Support for GLM-4.7, GLM-4.6, GLM-4.5, GLM-4.5-air
- Streaming: Full support for streaming responses
- Document Analysis: Pre-built workflows for common tasks
Installation
bun add @ebowwa/teammates-glmQuick Start
import { GLMProvider } from '@ebowwa/teammates-glm';
// Create provider
const provider = new GLMProvider({
defaultModel: 'GLM-4.7',
defaultTemperature: 0.7,
});
// Simple chat
const result = await provider.chat('Explain quantum computing');
console.log(result.content);
// Create teammates
const team = await provider.createTeam('research', [
{
teamName: 'research',
name: 'analyzer',
prompt: 'Analyze the data',
color: 'blue',
},
]);Environment Setup
Set your GLM API key:
export Z_AI_API_KEY='your-api-key'
# or
export ZAI_API_KEY='your-api-key'
# or
export GLM_API_KEY='your-api-key'Or configure via Doppler for production use.
API Reference
GLMProvider
// Constructor
const provider = new GLMProvider({
apiKey?: string, // Defaults to Z_AI_API_KEY
baseURL?: string, // Defaults to GLM endpoint
defaultModel?: string, // Defaults to 'GLM-4.7'
defaultTemperature?: number, // Defaults to 0.7
defaultMaxTokens?: number,
});
// Chat methods
await provider.chat(prompt, options?)
await provider.chatMessages(messages, options?)
// Streaming
for await (const chunk of provider.chatStream(prompt, options?)) {
console.log(chunk);
}
// Teammate creation
await provider.createTeammate({
teamName: 'my-team',
name: 'analyst',
prompt: 'Your task...',
model?: 'GLM-4.7',
systemPrompt?: 'Instructions...',
color?: 'blue',
temperature?: 0.7,
maxTokens?: 4096,
});
// Batch teammate creation
await provider.createTeam(teamName, [teammateOptions, ...], description?)
// Document analysis workflow
await provider.analyzeDocument(documentPath, teamName?)Example Workflows
Document Analysis Team
import { GLMProvider } from '@ebowwa/teammates-glm';
const provider = new GLMProvider();
const team = await provider.analyzeDocument(
'/path/to/research.md',
'my-analysis'
);
// Team will have 2 teammates:
// - analyzer (blue): Extracts key information
// - summarizer (green): Creates executive summaryCustom Team with Multiple Agents
const provider = new GLMProvider();
const team = await provider.createTeam(
'code-review',
[
{
teamName: 'code-review',
name: 'security-reviewer',
prompt: 'Review code for security vulnerabilities',
color: 'red',
model: 'GLM-4.7',
},
{
teamName: 'code-review',
name: 'performance-reviewer',
prompt: 'Review code for performance issues',
color: 'yellow',
model: 'GLM-4.5-air', // Faster model
},
{
teamName: 'code-review',
name: 'style-reviewer',
prompt: 'Review code for style and conventions',
color: 'green',
},
],
'Multi-perspective code review'
);Streaming Chat
const provider = new GLMProvider();
for await (const chunk of provider.chatStream('Write a haiku about AI')) {
process.stdout.write(chunk);
}Dependencies
This plugin composes with:
@ebowwa/ai- GLM client implementation@ebowwa/teammates- Multi-agent coordination@ebowwa/codespaces-types- Shared type definitions
Architecture
┌─────────────────────────────────────┐
│ @ebowwa/teammates-glm │
│ (GLM Provider Plugin) │
└──────────────┬──────────────────────┘
│
├──► @ebowwa/ai (GLMClient)
│ └──► Z.AI API
│
└──► @ebowwa/teammates
└──► Team coordinationLicense
MIT
Author
Ebowwa Labs [email protected]
