janito 2.9.0__py3-none-any.whl → 2.10.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- janito/README.md +149 -0
- janito/cli/chat_mode/script_runner.py +2 -2
- janito/cli/main_cli.py +1 -1
- janito/docs/GETTING_STARTED.md +117 -0
- janito/docs/PROVIDERS.md +224 -0
- janito/drivers/azure_openai/driver.py +7 -0
- janito/drivers/openai/driver.py +7 -0
- janito/mkdocs.yml +40 -0
- janito/provider_registry.py +14 -4
- janito/providers/__init__.py +1 -1
- janito/providers/alibaba/__init__.py +0 -0
- janito/providers/alibaba/model_info.py +33 -0
- janito/providers/alibaba/provider.py +102 -0
- janito/providers/anthropic/provider.py +6 -0
- janito/providers/azure_openai/provider.py +6 -0
- janito/providers/deepseek/provider.py +6 -0
- janito/providers/google/provider.py +6 -0
- janito/providers/moonshotai/model_info.py +11 -0
- janito/providers/moonshotai/provider.py +7 -1
- janito/providers/openai/provider.py +6 -0
- {janito-2.9.0.dist-info → janito-2.10.0.dist-info}/METADATA +1 -1
- {janito-2.9.0.dist-info → janito-2.10.0.dist-info}/RECORD +26 -22
- janito/providers/groq/__init__.py +0 -1
- janito/providers/groq/model_info.py +0 -45
- janito/providers/groq/provider.py +0 -76
- {janito-2.9.0.dist-info → janito-2.10.0.dist-info}/WHEEL +0 -0
- {janito-2.9.0.dist-info → janito-2.10.0.dist-info}/entry_points.txt +0 -0
- {janito-2.9.0.dist-info → janito-2.10.0.dist-info}/licenses/LICENSE +0 -0
- {janito-2.9.0.dist-info → janito-2.10.0.dist-info}/top_level.txt +0 -0
janito/README.md
ADDED
@@ -0,0 +1,149 @@
|
|
1
|
+
# Janito CLI
|
2
|
+
|
3
|
+
A powerful command-line tool for running LLM-powered workflows with built-in tool execution capabilities.
|
4
|
+
|
5
|
+
## Quick Start
|
6
|
+
|
7
|
+
### Installation
|
8
|
+
|
9
|
+
```bash
|
10
|
+
pip install janito
|
11
|
+
```
|
12
|
+
|
13
|
+
### First-Time Setup
|
14
|
+
|
15
|
+
1. **Get your API key**: Sign up at [Moonshot AI](https://platform.moonshot.cn/) and get your API key
|
16
|
+
2. **Set your API key**:
|
17
|
+
```bash
|
18
|
+
janito --set-api-key YOUR_MOONSHOT_API_KEY -p moonshotai
|
19
|
+
```
|
20
|
+
|
21
|
+
### Basic Usage
|
22
|
+
|
23
|
+
**MoonshotAI (Recommended - Default Provider)**
|
24
|
+
```bash
|
25
|
+
# Using the default provider (moonshotai) and model
|
26
|
+
janito "Create a Python script that reads a CSV file"
|
27
|
+
|
28
|
+
# Using a specific MoonshotAI model
|
29
|
+
janito -m kimi-k1-8k "Explain quantum computing"
|
30
|
+
```
|
31
|
+
|
32
|
+
**Other Providers**
|
33
|
+
```bash
|
34
|
+
# OpenAI
|
35
|
+
janito -p openai -m gpt-4 "Write a React component"
|
36
|
+
|
37
|
+
# Anthropic
|
38
|
+
janito -p anthropic -m claude-3-5-sonnet-20241022 "Analyze this code"
|
39
|
+
|
40
|
+
# Google
|
41
|
+
janito -p google -m gemini-2.0-flash-exp "Generate unit tests"
|
42
|
+
```
|
43
|
+
|
44
|
+
### Interactive Chat Mode
|
45
|
+
|
46
|
+
Start an interactive session:
|
47
|
+
```bash
|
48
|
+
janito --chat
|
49
|
+
```
|
50
|
+
|
51
|
+
In chat mode, you can:
|
52
|
+
|
53
|
+
- Have multi-turn conversations
|
54
|
+
- Execute code and commands
|
55
|
+
- Read and write files
|
56
|
+
- Use built-in tools
|
57
|
+
|
58
|
+
### Available Commands
|
59
|
+
|
60
|
+
- `janito --list-providers` - List all supported providers
|
61
|
+
- `janito --list-models` - List all available models
|
62
|
+
- `janito --list-tools` - List available tools
|
63
|
+
- `janito --show-config` - Show current configuration
|
64
|
+
|
65
|
+
### Configuration
|
66
|
+
|
67
|
+
Set default provider and model:
|
68
|
+
```bash
|
69
|
+
janito --set provider=moonshotai
|
70
|
+
janito --set model=kimi-k1-8k
|
71
|
+
```
|
72
|
+
|
73
|
+
## Providers
|
74
|
+
|
75
|
+
### MoonshotAI (Recommended)
|
76
|
+
|
77
|
+
- **Models**: kimi-k1-8k, kimi-k1-32k, kimi-k1-128k, kimi-k2-turbo-preview
|
78
|
+
- **Strengths**: Excellent Chinese/English support, competitive pricing, fast responses
|
79
|
+
- **Setup**: Get API key from [Moonshot AI Platform](https://platform.moonshot.cn/)
|
80
|
+
|
81
|
+
### OpenAI
|
82
|
+
|
83
|
+
- **Models**: gpt-4, gpt-4-turbo, gpt-3.5-turbo
|
84
|
+
- **Setup**: Get API key from [OpenAI Platform](https://platform.openai.com/)
|
85
|
+
|
86
|
+
### Anthropic
|
87
|
+
|
88
|
+
- **Models**: claude-3-5-sonnet-20241022, claude-3-opus-20240229
|
89
|
+
- **Setup**: Get API key from [Anthropic Console](https://console.anthropic.com/)
|
90
|
+
|
91
|
+
### Google
|
92
|
+
|
93
|
+
- **Models**: gemini-2.0-flash-exp, gemini-1.5-pro
|
94
|
+
- **Setup**: Get API key from [Google AI Studio](https://makersuite.google.com/)
|
95
|
+
|
96
|
+
## Advanced Features
|
97
|
+
|
98
|
+
### Tool Usage
|
99
|
+
|
100
|
+
Janito includes powerful built-in tools for:
|
101
|
+
|
102
|
+
- File operations (read, write, search)
|
103
|
+
- Code execution
|
104
|
+
- Web scraping
|
105
|
+
- System commands
|
106
|
+
- And more...
|
107
|
+
|
108
|
+
### Profiles and Roles
|
109
|
+
Use predefined system prompts:
|
110
|
+
```bash
|
111
|
+
janito --profile developer "Create a REST API"
|
112
|
+
janito --role python-expert "Optimize this algorithm"
|
113
|
+
```
|
114
|
+
|
115
|
+
### Environment Variables
|
116
|
+
You can also configure via environment variables:
|
117
|
+
```bash
|
118
|
+
export MOONSHOTAI_API_KEY=your_key_here
|
119
|
+
export JANITO_PROVIDER=moonshotai
|
120
|
+
export JANITO_MODEL=kimi-k1-8k
|
121
|
+
```
|
122
|
+
|
123
|
+
## Examples
|
124
|
+
|
125
|
+
### Code Generation
|
126
|
+
```bash
|
127
|
+
janito "Create a Python FastAPI application with user authentication"
|
128
|
+
```
|
129
|
+
|
130
|
+
### File Analysis
|
131
|
+
```bash
|
132
|
+
janito "Analyze the performance bottlenecks in my_app.py"
|
133
|
+
```
|
134
|
+
|
135
|
+
### Data Processing
|
136
|
+
```bash
|
137
|
+
janito "Process this CSV file and generate summary statistics"
|
138
|
+
```
|
139
|
+
|
140
|
+
### Web Development
|
141
|
+
```bash
|
142
|
+
janito "Create a responsive landing page with Tailwind CSS"
|
143
|
+
```
|
144
|
+
|
145
|
+
## Support
|
146
|
+
|
147
|
+
- **Documentation**: Check individual provider directories for detailed setup guides
|
148
|
+
- **Issues**: Report bugs and feature requests on GitHub
|
149
|
+
- **Discord**: Join our community for help and discussions
|
@@ -52,8 +52,8 @@ class ChatScriptRunner:
|
|
52
52
|
inputs: List[str],
|
53
53
|
*,
|
54
54
|
console: Optional[Console] = None,
|
55
|
-
provider: str = "
|
56
|
-
model: str = "
|
55
|
+
provider: str = "moonshotai",
|
56
|
+
model: str = "kimi-k1-8k",
|
57
57
|
use_real_agent: bool = True,
|
58
58
|
**chat_session_kwargs,
|
59
59
|
) -> None:
|
janito/cli/main_cli.py
CHANGED
@@ -214,7 +214,7 @@ class JanitoCLI:
|
|
214
214
|
|
215
215
|
self.parser = argparse.ArgumentParser(
|
216
216
|
description="Janito CLI - A tool for running LLM-powered workflows from the command line."
|
217
|
-
"\n\nExample usage: janito -p
|
217
|
+
"\n\nExample usage: janito -p moonshotai -m kimi-k1-8k 'Your prompt here'\n\n"
|
218
218
|
"Use -m or --model to set the model for the session."
|
219
219
|
)
|
220
220
|
self._define_args()
|
@@ -0,0 +1,117 @@
|
|
1
|
+
# Getting Started with Janito
|
2
|
+
|
3
|
+
This guide will help you set up Janito CLI quickly and start using it with MoonshotAI as your default provider.
|
4
|
+
|
5
|
+
## Quick Setup (2 minutes)
|
6
|
+
|
7
|
+
### 1. Install Janito
|
8
|
+
```bash
|
9
|
+
pip install janito
|
10
|
+
```
|
11
|
+
|
12
|
+
### 2. Get Your MoonshotAI API Key
|
13
|
+
|
14
|
+
1. Go to [Moonshot AI Platform](https://platform.moonshot.cn/)
|
15
|
+
2. Sign up for an account
|
16
|
+
3. Navigate to API Keys section
|
17
|
+
4. Create a new API key
|
18
|
+
|
19
|
+
### 3. Configure Janito
|
20
|
+
```bash
|
21
|
+
# Set MoonshotAI as your default provider
|
22
|
+
janito --set-api-key YOUR_API_KEY -p moonshotai
|
23
|
+
|
24
|
+
# Verify it's working
|
25
|
+
janito "Hello, can you introduce yourself?"
|
26
|
+
```
|
27
|
+
|
28
|
+
## Your First Commands
|
29
|
+
|
30
|
+
### Basic Usage
|
31
|
+
```bash
|
32
|
+
# Simple prompt
|
33
|
+
janito "Create a Python script to calculate fibonacci numbers"
|
34
|
+
|
35
|
+
# With specific model
|
36
|
+
janito -m kimi-k1-8k "Explain machine learning in simple terms"
|
37
|
+
|
38
|
+
# Interactive chat mode
|
39
|
+
janito --chat
|
40
|
+
```
|
41
|
+
|
42
|
+
### Working with Files
|
43
|
+
```bash
|
44
|
+
# Analyze a file
|
45
|
+
janito "Analyze the performance of my_app.py" < my_app.py
|
46
|
+
|
47
|
+
# Generate code in a specific directory
|
48
|
+
janito -W ./my_project "Create a REST API with FastAPI"
|
49
|
+
```
|
50
|
+
|
51
|
+
## Configuration Options
|
52
|
+
|
53
|
+
### Set as Default Provider
|
54
|
+
```bash
|
55
|
+
# Make MoonshotAI your permanent default
|
56
|
+
janito --set provider=moonshotai
|
57
|
+
janito --set model=kimi-k1-8k
|
58
|
+
```
|
59
|
+
|
60
|
+
### Environment Variables
|
61
|
+
You can also use environment variables:
|
62
|
+
```bash
|
63
|
+
export MOONSHOTAI_API_KEY=your_key_here
|
64
|
+
export JANITO_PROVIDER=moonshotai
|
65
|
+
export JANITO_MODEL=kimi-k1-8k
|
66
|
+
```
|
67
|
+
|
68
|
+
## MoonshotAI Models
|
69
|
+
|
70
|
+
Janito supports these MoonshotAI models:
|
71
|
+
|
72
|
+
- **kimi-k1-8k**: Fast responses, good for general tasks
|
73
|
+
- **kimi-k1-32k**: Better for longer contexts
|
74
|
+
- **kimi-k1-128k**: Best for very long documents
|
75
|
+
- **kimi-k2-turbo-preview**: Latest model with enhanced capabilities
|
76
|
+
- **kimi-k2-turbo-preview**: Turbo version of the advanced reasoning model
|
77
|
+
|
78
|
+
## Next Steps
|
79
|
+
|
80
|
+
1. **Explore tools**: Run `janito --list-tools` to see available tools
|
81
|
+
2. **Try chat mode**: Run `janito --chat` for interactive sessions
|
82
|
+
3. **Check examples**: Look at the main README.md for more usage examples
|
83
|
+
4. **Join community**: Get help and share tips with other users
|
84
|
+
|
85
|
+
## Troubleshooting
|
86
|
+
|
87
|
+
### Common Issues
|
88
|
+
|
89
|
+
**"Provider not found" error**
|
90
|
+
```bash
|
91
|
+
# Check available providers
|
92
|
+
janito --list-providers
|
93
|
+
|
94
|
+
# Re-register MoonshotAI
|
95
|
+
janito --set-api-key YOUR_KEY -p moonshotai
|
96
|
+
```
|
97
|
+
|
98
|
+
**"Model not available" error**
|
99
|
+
```bash
|
100
|
+
# List available MoonshotAI models
|
101
|
+
janito -p moonshotai --list-models
|
102
|
+
```
|
103
|
+
|
104
|
+
**API key issues**
|
105
|
+
```bash
|
106
|
+
# Check current configuration
|
107
|
+
janito --show-config
|
108
|
+
|
109
|
+
# Reset API key
|
110
|
+
janito --set-api-key NEW_KEY -p moonshotai
|
111
|
+
```
|
112
|
+
|
113
|
+
### Getting Help
|
114
|
+
|
115
|
+
- Check the main README.md for comprehensive documentation
|
116
|
+
- Use `janito --help` for command-line options
|
117
|
+
- Visit our GitHub repository for issues and discussions
|
janito/docs/PROVIDERS.md
ADDED
@@ -0,0 +1,224 @@
|
|
1
|
+
# Provider Configuration Guide
|
2
|
+
|
3
|
+
This guide covers how to configure and use different LLM providers with Janito.
|
4
|
+
|
5
|
+
## MoonshotAI (Recommended)
|
6
|
+
|
7
|
+
**MoonshotAI** is the recommended default provider for Janito, offering excellent performance and competitive pricing.
|
8
|
+
|
9
|
+
### Setup
|
10
|
+
```bash
|
11
|
+
# Set API key
|
12
|
+
janito --set-api-key YOUR_API_KEY -p moonshotai
|
13
|
+
|
14
|
+
# Set as default provider
|
15
|
+
janito --set provider=moonshotai
|
16
|
+
janito --set model=kimi-k1-8k
|
17
|
+
```
|
18
|
+
|
19
|
+
### Available Models
|
20
|
+
|
21
|
+
- **kimi-k1-8k**: Fast, general-purpose model (8k context)
|
22
|
+
- **kimi-k1-32k**: Extended context model (32k context)
|
23
|
+
- **kimi-k1-128k**: Long context model (128k context)
|
24
|
+
- **kimi-k2-turbo-preview**: Latest enhanced model
|
25
|
+
|
26
|
+
### Environment Variables
|
27
|
+
```bash
|
28
|
+
export MOONSHOTAI_API_KEY=your_key_here
|
29
|
+
```
|
30
|
+
|
31
|
+
## OpenAI
|
32
|
+
|
33
|
+
### Setup
|
34
|
+
```bash
|
35
|
+
# Set API key
|
36
|
+
janito --set-api-key YOUR_API_KEY -p openai
|
37
|
+
|
38
|
+
# Use specific model
|
39
|
+
janito -p openai -m gpt-4 "Your prompt"
|
40
|
+
```
|
41
|
+
|
42
|
+
### Available Models
|
43
|
+
|
44
|
+
- **gpt-4**: Most capable model
|
45
|
+
- **gpt-4-turbo**: Faster, more efficient
|
46
|
+
- **gpt-3.5-turbo**: Cost-effective option
|
47
|
+
|
48
|
+
### Environment Variables
|
49
|
+
```bash
|
50
|
+
export OPENAI_API_KEY=your_key_here
|
51
|
+
```
|
52
|
+
|
53
|
+
## Anthropic
|
54
|
+
|
55
|
+
### Setup
|
56
|
+
```bash
|
57
|
+
# Set API key
|
58
|
+
janito --set-api-key YOUR_API_KEY -p anthropic
|
59
|
+
|
60
|
+
# Use Claude models
|
61
|
+
janito -p anthropic -m claude-3-5-sonnet-20241022 "Your prompt"
|
62
|
+
```
|
63
|
+
|
64
|
+
### Available Models
|
65
|
+
|
66
|
+
- **claude-3-5-sonnet-20241022**: Most capable
|
67
|
+
- **claude-3-opus-20240229**: High performance
|
68
|
+
- **claude-3-haiku-20240307**: Fast and cost-effective
|
69
|
+
|
70
|
+
### Environment Variables
|
71
|
+
```bash
|
72
|
+
export ANTHROPIC_API_KEY=your_key_here
|
73
|
+
```
|
74
|
+
|
75
|
+
## Google
|
76
|
+
|
77
|
+
### Setup
|
78
|
+
```bash
|
79
|
+
# Set API key
|
80
|
+
janito --set-api-key YOUR_API_KEY -p google
|
81
|
+
|
82
|
+
# Use Gemini models
|
83
|
+
janito -p google -m gemini-2.0-flash-exp "Your prompt"
|
84
|
+
```
|
85
|
+
|
86
|
+
### Available Models
|
87
|
+
|
88
|
+
- **gemini-2.0-flash-exp**: Latest experimental model
|
89
|
+
- **gemini-1.5-pro**: Production-ready
|
90
|
+
- **gemini-1.5-flash**: Fast and efficient
|
91
|
+
|
92
|
+
### Environment Variables
|
93
|
+
```bash
|
94
|
+
export GOOGLE_API_KEY=your_key_here
|
95
|
+
```
|
96
|
+
|
97
|
+
## Azure OpenAI
|
98
|
+
|
99
|
+
### Setup
|
100
|
+
```bash
|
101
|
+
# Set configuration
|
102
|
+
janito --set-api-key YOUR_API_KEY -p azure-openai
|
103
|
+
janito --set azure_deployment_name=your_deployment_name -p azure-openai
|
104
|
+
```
|
105
|
+
|
106
|
+
### Configuration
|
107
|
+
|
108
|
+
Requires both API key and deployment name:
|
109
|
+
|
110
|
+
- **API Key**: Your Azure OpenAI key
|
111
|
+
- **Deployment Name**: Your Azure deployment name
|
112
|
+
- **Base URL**: Your Azure endpoint URL
|
113
|
+
|
114
|
+
### Environment Variables
|
115
|
+
```bash
|
116
|
+
export AZURE_OPENAI_API_KEY=your_key_here
|
117
|
+
export AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
|
118
|
+
```
|
119
|
+
|
120
|
+
## Other Providers
|
121
|
+
|
122
|
+
Janito also supports these providers through OpenAI-compatible APIs:
|
123
|
+
|
124
|
+
### Alibaba Cloud
|
125
|
+
```bash
|
126
|
+
janito --set-api-key YOUR_KEY -p alibaba
|
127
|
+
```
|
128
|
+
|
129
|
+
### DeepSeek
|
130
|
+
```bash
|
131
|
+
janito --set-api-key YOUR_KEY -p deepseek
|
132
|
+
```
|
133
|
+
|
134
|
+
### Groq
|
135
|
+
```bash
|
136
|
+
janito --set-api-key YOUR_KEY -p groq
|
137
|
+
```
|
138
|
+
|
139
|
+
### Mistral
|
140
|
+
```bash
|
141
|
+
janito --set-api-key YOUR_KEY -p mistral
|
142
|
+
```
|
143
|
+
|
144
|
+
## Configuration Management
|
145
|
+
|
146
|
+
### Check Current Configuration
|
147
|
+
```bash
|
148
|
+
janito --show-config
|
149
|
+
```
|
150
|
+
|
151
|
+
### List All Providers
|
152
|
+
```bash
|
153
|
+
janito --list-providers
|
154
|
+
```
|
155
|
+
|
156
|
+
### List Models for a Provider
|
157
|
+
```bash
|
158
|
+
janito -p moonshotai --list-models
|
159
|
+
janito -p openai --list-models
|
160
|
+
```
|
161
|
+
|
162
|
+
### Switch Providers
|
163
|
+
```bash
|
164
|
+
# Temporarily for one command
|
165
|
+
janito -p openai -m gpt-4 "Your prompt"
|
166
|
+
|
167
|
+
# Permanently as default
|
168
|
+
janito --set provider=openai
|
169
|
+
janito --set model=gpt-4
|
170
|
+
```
|
171
|
+
|
172
|
+
## Advanced Configuration
|
173
|
+
|
174
|
+
### Custom Base URLs
|
175
|
+
For OpenAI-compatible providers, you can set custom base URLs:
|
176
|
+
|
177
|
+
```bash
|
178
|
+
janito --set base_url=https://your-custom-endpoint.com -p openai
|
179
|
+
```
|
180
|
+
|
181
|
+
### Provider-Specific Settings
|
182
|
+
Each provider can have custom settings:
|
183
|
+
|
184
|
+
```bash
|
185
|
+
# Set temperature for a specific provider/model
|
186
|
+
janito --set temperature=0.7 -p moonshotai -m kimi-k1-8k
|
187
|
+
|
188
|
+
# Set max tokens
|
189
|
+
janito --set max_tokens=2000 -p openai -m gpt-4
|
190
|
+
```
|
191
|
+
|
192
|
+
## Troubleshooting
|
193
|
+
|
194
|
+
### Provider Not Found
|
195
|
+
```bash
|
196
|
+
# Check if provider is registered
|
197
|
+
janito --list-providers
|
198
|
+
|
199
|
+
# Re-register provider
|
200
|
+
janito --set-api-key YOUR_KEY -p PROVIDER_NAME
|
201
|
+
```
|
202
|
+
|
203
|
+
### API Key Issues
|
204
|
+
```bash
|
205
|
+
# Check current API key
|
206
|
+
janito --show-config
|
207
|
+
|
208
|
+
# Reset API key
|
209
|
+
janito --set-api-key NEW_KEY -p PROVIDER_NAME
|
210
|
+
```
|
211
|
+
|
212
|
+
### Model Not Available
|
213
|
+
```bash
|
214
|
+
# List available models for provider
|
215
|
+
janito -p PROVIDER_NAME --list-models
|
216
|
+
```
|
217
|
+
|
218
|
+
## Best Practices
|
219
|
+
|
220
|
+
1. **Start with MoonshotAI**: It's the recommended default for good reason
|
221
|
+
2. **Use environment variables**: For CI/CD and containerized environments
|
222
|
+
3. **Test different models**: Each has different strengths and pricing
|
223
|
+
4. **Monitor usage**: Keep track of API costs and rate limits
|
224
|
+
5. **Use profiles**: Set up different configurations for different use cases
|
@@ -63,6 +63,13 @@ class AzureOpenAIModelDriver(OpenAIModelDriver):
|
|
63
63
|
|
64
64
|
def _instantiate_openai_client(self, config):
|
65
65
|
try:
|
66
|
+
if not config.api_key:
|
67
|
+
provider_name = getattr(self, 'provider_name', 'Azure OpenAI')
|
68
|
+
print(f"[ERROR] No API key found for provider '{provider_name}'. Please set the API key using:")
|
69
|
+
print(f" janito --set-api-key YOUR_API_KEY -p azure-openai")
|
70
|
+
print(f"Or set the AZURE_OPENAI_API_KEY environment variable.")
|
71
|
+
raise ValueError(f"API key is required for provider '{provider_name}'")
|
72
|
+
|
66
73
|
from openai import AzureOpenAI
|
67
74
|
|
68
75
|
api_key_display = str(config.api_key)
|
janito/drivers/openai/driver.py
CHANGED
@@ -246,6 +246,13 @@ class OpenAIModelDriver(LLMDriver):
|
|
246
246
|
|
247
247
|
def _instantiate_openai_client(self, config):
|
248
248
|
try:
|
249
|
+
if not config.api_key:
|
250
|
+
provider_name = getattr(self, 'provider_name', 'OpenAI-compatible')
|
251
|
+
print(f"[ERROR] No API key found for provider '{provider_name}'. Please set the API key using:")
|
252
|
+
print(f" janito --set-api-key YOUR_API_KEY -p {provider_name.lower()}")
|
253
|
+
print(f"Or set the {provider_name.upper()}_API_KEY environment variable.")
|
254
|
+
raise ValueError(f"API key is required for provider '{provider_name}'")
|
255
|
+
|
249
256
|
api_key_display = str(config.api_key)
|
250
257
|
if api_key_display and len(api_key_display) > 8:
|
251
258
|
api_key_display = api_key_display[:4] + "..." + api_key_display[-4:]
|
janito/mkdocs.yml
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
site_name: Janito CLI Documentation
|
2
|
+
site_description: A powerful command-line tool for running LLM-powered workflows
|
3
|
+
site_url: https://janito.readthedocs.io/
|
4
|
+
|
5
|
+
nav:
|
6
|
+
- Home: README.md
|
7
|
+
- Getting Started: docs/GETTING_STARTED.md
|
8
|
+
- Providers: docs/PROVIDERS.md
|
9
|
+
- Tools: docs/TOOLS_REFERENCE.md
|
10
|
+
|
11
|
+
markdown_extensions:
|
12
|
+
- admonition
|
13
|
+
- codehilite
|
14
|
+
- toc:
|
15
|
+
permalink: true
|
16
|
+
- pymdownx.superfences
|
17
|
+
- pymdownx.tabbed:
|
18
|
+
alternate_style: true
|
19
|
+
|
20
|
+
theme:
|
21
|
+
name: material
|
22
|
+
palette:
|
23
|
+
- scheme: default
|
24
|
+
primary: blue
|
25
|
+
accent: blue
|
26
|
+
features:
|
27
|
+
- navigation.tabs
|
28
|
+
- navigation.sections
|
29
|
+
- navigation.expand
|
30
|
+
- search.highlight
|
31
|
+
- search.share
|
32
|
+
|
33
|
+
repo_url: https://github.com/ikignosis/janito
|
34
|
+
repo_name: ikignosis/janito
|
35
|
+
edit_uri: edit/main/docs/
|
36
|
+
|
37
|
+
extra:
|
38
|
+
social:
|
39
|
+
- icon: fontawesome/brands/github
|
40
|
+
link: https://github.com/ikignosis/janito
|
janito/provider_registry.py
CHANGED
@@ -93,11 +93,21 @@ class ProviderRegistry:
|
|
93
93
|
model_specs = model_info_mod.MODEL_SPECS
|
94
94
|
elif hasattr(model_info_mod, "MOONSHOTAI_MODEL_SPECS"):
|
95
95
|
model_specs = model_info_mod.MOONSHOTAI_MODEL_SPECS
|
96
|
-
|
97
|
-
if provider_name == "groq":
|
98
|
-
return "<any> (must be provided)"
|
96
|
+
|
99
97
|
if model_specs:
|
100
|
-
|
98
|
+
default_model = getattr(provider_class, "DEFAULT_MODEL", None)
|
99
|
+
model_names = []
|
100
|
+
|
101
|
+
for model_key in model_specs.keys():
|
102
|
+
if model_key == default_model:
|
103
|
+
# Highlight the default model with color and star icon
|
104
|
+
model_names.append(f"[bold green]⭐ {model_key}[/bold green]")
|
105
|
+
else:
|
106
|
+
model_names.append(model_key)
|
107
|
+
|
108
|
+
if provider_name == "moonshotai":
|
109
|
+
return ", ".join(model_names)
|
110
|
+
return ", ".join(model_names)
|
101
111
|
return "-"
|
102
112
|
except Exception as e:
|
103
113
|
return "-"
|
janito/providers/__init__.py
CHANGED
File without changes
|
@@ -0,0 +1,33 @@
|
|
1
|
+
from janito.llm.model import LLMModelInfo
|
2
|
+
|
3
|
+
MODEL_SPECS = {
|
4
|
+
"qwen-turbo": LLMModelInfo(
|
5
|
+
name="qwen-turbo",
|
6
|
+
context=1008192,
|
7
|
+
max_response=8192,
|
8
|
+
category="Alibaba Qwen Turbo Model (OpenAI-compatible)",
|
9
|
+
driver="OpenAIModelDriver",
|
10
|
+
),
|
11
|
+
"qwen-plus": LLMModelInfo(
|
12
|
+
name="qwen-plus",
|
13
|
+
context=131072,
|
14
|
+
max_response=8192,
|
15
|
+
category="Alibaba Qwen Plus Model (OpenAI-compatible)",
|
16
|
+
driver="OpenAIModelDriver",
|
17
|
+
),
|
18
|
+
"qwen-max": LLMModelInfo(
|
19
|
+
name="qwen-max",
|
20
|
+
context=32768,
|
21
|
+
max_response=8192,
|
22
|
+
category="Alibaba Qwen Max Model (OpenAI-compatible)",
|
23
|
+
driver="OpenAIModelDriver",
|
24
|
+
),
|
25
|
+
|
26
|
+
"qwen3-coder-plus": LLMModelInfo(
|
27
|
+
name="qwen3-coder-plus",
|
28
|
+
context=1048576,
|
29
|
+
max_response=65536,
|
30
|
+
category="Alibaba Qwen3 Coder Plus Model (OpenAI-compatible)",
|
31
|
+
driver="OpenAIModelDriver",
|
32
|
+
),
|
33
|
+
}
|
@@ -0,0 +1,102 @@
|
|
1
|
+
from janito.llm.provider import LLMProvider
|
2
|
+
from janito.llm.model import LLMModelInfo
|
3
|
+
from janito.llm.auth import LLMAuthManager
|
4
|
+
from janito.llm.driver_config import LLMDriverConfig
|
5
|
+
from janito.drivers.openai.driver import OpenAIModelDriver
|
6
|
+
from janito.tools import get_local_tools_adapter
|
7
|
+
from janito.providers.registry import LLMProviderRegistry
|
8
|
+
from .model_info import MODEL_SPECS
|
9
|
+
from queue import Queue
|
10
|
+
|
11
|
+
available = OpenAIModelDriver.available
|
12
|
+
unavailable_reason = OpenAIModelDriver.unavailable_reason
|
13
|
+
|
14
|
+
|
15
|
+
class AlibabaProvider(LLMProvider):
|
16
|
+
name = "alibaba"
|
17
|
+
NAME = "alibaba"
|
18
|
+
MAINTAINER = "João Pinto <janito@ikignosis.org>"
|
19
|
+
MODEL_SPECS = MODEL_SPECS
|
20
|
+
DEFAULT_MODEL = "qwen-turbo" # Options: qwen-turbo, qwen-plus, qwen-max
|
21
|
+
|
22
|
+
def __init__(
|
23
|
+
self, auth_manager: LLMAuthManager = None, config: LLMDriverConfig = None
|
24
|
+
):
|
25
|
+
# Always set a tools adapter so that even if the driver is unavailable,
|
26
|
+
# generic code paths that expect provider.execute_tool() continue to work.
|
27
|
+
self._tools_adapter = get_local_tools_adapter()
|
28
|
+
|
29
|
+
# Always initialize _driver_config to avoid AttributeError
|
30
|
+
self._driver_config = config or LLMDriverConfig(model=None)
|
31
|
+
|
32
|
+
if not self.available:
|
33
|
+
self._driver = None
|
34
|
+
else:
|
35
|
+
self.auth_manager = auth_manager or LLMAuthManager()
|
36
|
+
self._api_key = self.auth_manager.get_credentials(type(self).NAME)
|
37
|
+
if not self._api_key:
|
38
|
+
print(f"[ERROR] No API key found for provider '{self.name}'. Please set the API key using:")
|
39
|
+
print(f" janito --set-api-key YOUR_API_KEY -p {self.name}")
|
40
|
+
print(f"Or set the ALIBABA_API_KEY environment variable.")
|
41
|
+
|
42
|
+
if not self._driver_config.model:
|
43
|
+
self._driver_config.model = self.DEFAULT_MODEL
|
44
|
+
if not self._driver_config.api_key:
|
45
|
+
self._driver_config.api_key = self._api_key
|
46
|
+
# Set Alibaba international endpoint as default base_url if not provided
|
47
|
+
if not getattr(self._driver_config, "base_url", None):
|
48
|
+
self._driver_config.base_url = "https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
|
49
|
+
self.fill_missing_device_info(self._driver_config)
|
50
|
+
self._driver = None # to be provided by factory/agent
|
51
|
+
|
52
|
+
@property
|
53
|
+
def driver(self) -> OpenAIModelDriver:
|
54
|
+
if not self.available:
|
55
|
+
raise ImportError(f"AlibabaProvider unavailable: {self.unavailable_reason}")
|
56
|
+
return self._driver
|
57
|
+
|
58
|
+
@property
|
59
|
+
def available(self):
|
60
|
+
return available
|
61
|
+
|
62
|
+
@property
|
63
|
+
def unavailable_reason(self):
|
64
|
+
return unavailable_reason
|
65
|
+
|
66
|
+
def create_driver(self):
|
67
|
+
"""
|
68
|
+
Creates and returns a new OpenAIModelDriver instance with input/output queues.
|
69
|
+
"""
|
70
|
+
driver = OpenAIModelDriver(
|
71
|
+
tools_adapter=self._tools_adapter, provider_name=self.name
|
72
|
+
)
|
73
|
+
driver.config = self.driver_config
|
74
|
+
# NOTE: The caller is responsible for calling driver.start() if background processing is needed.
|
75
|
+
return driver
|
76
|
+
|
77
|
+
def create_agent(self, tools_adapter=None, agent_name: str = None, **kwargs):
|
78
|
+
from janito.llm.agent import LLMAgent
|
79
|
+
|
80
|
+
# Always create a new driver with the passed-in tools_adapter
|
81
|
+
if tools_adapter is None:
|
82
|
+
tools_adapter = get_local_tools_adapter()
|
83
|
+
# Should use new-style driver construction via queues/factory (handled elsewhere)
|
84
|
+
raise NotImplementedError(
|
85
|
+
"create_agent must be constructed via new factory using input/output queues and config."
|
86
|
+
)
|
87
|
+
|
88
|
+
@property
|
89
|
+
def model_name(self):
|
90
|
+
return self._driver_config.model
|
91
|
+
|
92
|
+
@property
|
93
|
+
def driver_config(self):
|
94
|
+
"""Public, read-only access to the provider's LLMDriverConfig object."""
|
95
|
+
return self._driver_config
|
96
|
+
|
97
|
+
def execute_tool(self, tool_name: str, event_bus, *args, **kwargs):
|
98
|
+
self._tools_adapter.event_bus = event_bus
|
99
|
+
return self._tools_adapter.execute_by_name(tool_name, *args, **kwargs)
|
100
|
+
|
101
|
+
|
102
|
+
LLMProviderRegistry.register(AlibabaProvider.NAME, AlibabaProvider)
|
@@ -21,6 +21,12 @@ class AnthropicProvider(LLMProvider):
|
|
21
21
|
self._tools_adapter = get_local_tools_adapter()
|
22
22
|
self.auth_manager = auth_manager or LLMAuthManager()
|
23
23
|
self._api_key = self.auth_manager.get_credentials(type(self).NAME)
|
24
|
+
if not self._api_key:
|
25
|
+
print(f"[ERROR] No API key found for provider '{self.name}'. Please set the API key using:")
|
26
|
+
print(f" janito --set-api-key YOUR_API_KEY -p {self.name}")
|
27
|
+
print(f"Or set the ANTHROPIC_API_KEY environment variable.")
|
28
|
+
return
|
29
|
+
|
24
30
|
self._tools_adapter = get_local_tools_adapter()
|
25
31
|
self._driver_config = config or LLMDriverConfig(model=None)
|
26
32
|
if not getattr(self._driver_config, "model", None):
|
@@ -32,6 +32,12 @@ class AzureOpenAIProvider(LLMProvider):
|
|
32
32
|
return
|
33
33
|
self._auth_manager = auth_manager or LLMAuthManager()
|
34
34
|
self._api_key = self._auth_manager.get_credentials(type(self).NAME)
|
35
|
+
if not self._api_key:
|
36
|
+
print(f"[ERROR] No API key found for provider '{self.name}'. Please set the API key using:")
|
37
|
+
print(f" janito --set-api-key YOUR_API_KEY -p {self.name}")
|
38
|
+
print(f"Or set the AZURE_OPENAI_API_KEY environment variable.")
|
39
|
+
return
|
40
|
+
|
35
41
|
self._tools_adapter = get_local_tools_adapter()
|
36
42
|
self._driver_config = config or LLMDriverConfig(model=None)
|
37
43
|
if not self._driver_config.model:
|
@@ -30,6 +30,12 @@ class DeepSeekProvider(LLMProvider):
|
|
30
30
|
else:
|
31
31
|
self.auth_manager = auth_manager or LLMAuthManager()
|
32
32
|
self._api_key = self.auth_manager.get_credentials(type(self).NAME)
|
33
|
+
if not self._api_key:
|
34
|
+
print(f"[ERROR] No API key found for provider '{self.name}'. Please set the API key using:")
|
35
|
+
print(f" janito --set-api-key YOUR_API_KEY -p {self.name}")
|
36
|
+
print(f"Or set the DEEPSEEK_API_KEY environment variable.")
|
37
|
+
return
|
38
|
+
|
33
39
|
self._tools_adapter = get_local_tools_adapter()
|
34
40
|
self._driver_config = config or LLMDriverConfig(model=None)
|
35
41
|
if not self._driver_config.model:
|
@@ -32,6 +32,12 @@ class GoogleProvider(LLMProvider):
|
|
32
32
|
else:
|
33
33
|
self.auth_manager = auth_manager or LLMAuthManager()
|
34
34
|
self._api_key = self.auth_manager.get_credentials(type(self).name)
|
35
|
+
if not self._api_key:
|
36
|
+
print(f"[ERROR] No API key found for provider '{self.name}'. Please set the API key using:")
|
37
|
+
print(f" janito --set-api-key YOUR_API_KEY -p {self.name}")
|
38
|
+
print(f"Or set the GOOGLE_API_KEY environment variable.")
|
39
|
+
return
|
40
|
+
|
35
41
|
self._tools_adapter = get_local_tools_adapter()
|
36
42
|
self._driver_config = config or LLMDriverConfig(model=None)
|
37
43
|
# Only set default if model is not set by CLI/config
|
@@ -12,4 +12,15 @@ MOONSHOTAI_MODEL_SPECS = {
|
|
12
12
|
open="moonshotai",
|
13
13
|
driver="OpenAIModelDriver",
|
14
14
|
),
|
15
|
+
"kimi-k2-turbo-preview": LLMModelInfo(
|
16
|
+
name="kimi-k2-turbo-preview",
|
17
|
+
context=128000,
|
18
|
+
max_input=100000,
|
19
|
+
max_cot="N/A",
|
20
|
+
max_response=4096,
|
21
|
+
thinking_supported=False,
|
22
|
+
default_temp=0.2,
|
23
|
+
open="moonshotai",
|
24
|
+
driver="OpenAIModelDriver",
|
25
|
+
),
|
15
26
|
}
|
@@ -12,7 +12,7 @@ class MoonshotAIProvider(LLMProvider):
|
|
12
12
|
NAME = "moonshotai"
|
13
13
|
MAINTAINER = "João Pinto <janito@ikignosis.org>"
|
14
14
|
MODEL_SPECS = MOONSHOTAI_MODEL_SPECS
|
15
|
-
DEFAULT_MODEL = "kimi-k2-
|
15
|
+
DEFAULT_MODEL = "kimi-k2-turbo-preview"
|
16
16
|
|
17
17
|
def __init__(
|
18
18
|
self, auth_manager: LLMAuthManager = None, config: LLMDriverConfig = None
|
@@ -23,6 +23,12 @@ class MoonshotAIProvider(LLMProvider):
|
|
23
23
|
else:
|
24
24
|
self.auth_manager = auth_manager or LLMAuthManager()
|
25
25
|
self._api_key = self.auth_manager.get_credentials(type(self).name)
|
26
|
+
if not self._api_key:
|
27
|
+
print(f"[ERROR] No API key found for provider '{self.name}'. Please set the API key using:")
|
28
|
+
print(f" janito --set-api-key YOUR_API_KEY -p {self.name}")
|
29
|
+
print(f"Or set the MOONSHOTAI_API_KEY environment variable.")
|
30
|
+
return
|
31
|
+
|
26
32
|
self._tools_adapter = get_local_tools_adapter()
|
27
33
|
self._driver_config = config or LLMDriverConfig(model=None)
|
28
34
|
if not self._driver_config.model:
|
@@ -31,6 +31,12 @@ class OpenAIProvider(LLMProvider):
|
|
31
31
|
else:
|
32
32
|
self.auth_manager = auth_manager or LLMAuthManager()
|
33
33
|
self._api_key = self.auth_manager.get_credentials(type(self).NAME)
|
34
|
+
if not self._api_key:
|
35
|
+
print(f"[ERROR] No API key found for provider '{self.name}'. Please set the API key using:")
|
36
|
+
print(f" janito --set-api-key YOUR_API_KEY -p {self.name}")
|
37
|
+
print(f"Or set the OPENAI_API_KEY environment variable.")
|
38
|
+
return
|
39
|
+
|
34
40
|
self._tools_adapter = get_local_tools_adapter()
|
35
41
|
self._driver_config = config or LLMDriverConfig(model=None)
|
36
42
|
if not self._driver_config.model:
|
@@ -1,3 +1,4 @@
|
|
1
|
+
janito/README.md,sha256=uxjCeZVAsRh5lHLm-d5tWD2y42fr17tCrLsTvr-CR0Q,3557
|
1
2
|
janito/__init__.py,sha256=a0pFui3A_AfWJiUfg93yE-Vf4868bqG3y9yg2fkTIuY,244
|
2
3
|
janito/__main__.py,sha256=lPQ8kAyYfyeS1KopmJ8EVY5g1YswlIqCS615mM_B_rM,70
|
3
4
|
janito/_version.py,sha256=PtAVr2K9fOS5sv6aXzmcb7UaR5NLGMFOofL7Ndjh75o,2344
|
@@ -10,11 +11,12 @@ janito/exceptions.py,sha256=l4AepRdWwAuLp5fUygrBBgO9rpwgfV6JvY1afOdq2pw,913
|
|
10
11
|
janito/formatting.py,sha256=SMvOmL6bst3KGcI7OLa5D4DE127fQYuHZS3oY8OPsn8,2031
|
11
12
|
janito/formatting_token.py,sha256=9Pz0svhV0pyNuGRXSmVkGDaQC8N-koTkf50AJR_gtSo,2217
|
12
13
|
janito/gitignore_utils.py,sha256=P3iF9fMWAomqULq2xsoqHtI9uNIFSPcagljrxZshmLw,4110
|
14
|
+
janito/mkdocs.yml,sha256=ve0ipJDpOpetaVOtzJf2oSSCx441r1FDMv0v6iSSxhk,920
|
13
15
|
janito/perf_singleton.py,sha256=g1h0Sdf4ydzegeEpJlMhQt4H0GQZ2hryXrdYOTL-b30,113
|
14
16
|
janito/performance_collector.py,sha256=RYu4av16Trj3RljJZ8-2Gbn1KlGdJUosrcVFYtwviNI,6285
|
15
17
|
janito/platform_discovery.py,sha256=JN3kC7hkxdvuj-AyrJTlbbDJjtNHke3fdlZDqGi_uz0,4621
|
16
18
|
janito/provider_config.py,sha256=acn2FEgWsEIyi2AxZiuCLoP2rXDd-nXcP5VB4CZHaeE,3189
|
17
|
-
janito/provider_registry.py,sha256=
|
19
|
+
janito/provider_registry.py,sha256=l0jJZ74KIebOSYXPiy7uqH8d48pckR_WTyAO4iQF98o,6571
|
18
20
|
janito/report_events.py,sha256=q4OR_jTZNfcqaQF_fzTjgqo6_VlUIxSGWfhpT4nJWcw,938
|
19
21
|
janito/shell.bak.zip,sha256=hznHbmgfkAkjuQDJ3w73XPQh05yrtUZQxLmtGbanbYU,22
|
20
22
|
janito/utils.py,sha256=eXSsMgM69YyzahgCNrJQLcEbB8ssLI1MQqaa20ONxbE,376
|
@@ -26,7 +28,7 @@ janito/cli/__init__.py,sha256=xaPDOrWphBbCR63Xpcx_yfpXSJIlCaaICc4j2qpWqrM,194
|
|
26
28
|
janito/cli/config.py,sha256=HkZ14701HzIqrvaNyDcDhGlVHfpX_uHlLp2rHmhRm_k,872
|
27
29
|
janito/cli/console.py,sha256=gJolqzWL7jEPLxeuH-CwBDRFpXt976KdZOEAB2tdBDs,64
|
28
30
|
janito/cli/main.py,sha256=s5odou0txf8pzTf1ADk2yV7T5m8B6cejJ81e7iu776U,312
|
29
|
-
janito/cli/main_cli.py,sha256=
|
31
|
+
janito/cli/main_cli.py,sha256=MAAQpD7VyGHveref4XtF7WDI6Qew81yA65lu23V2LYk,14182
|
30
32
|
janito/cli/prompt_core.py,sha256=F68J4Xl6jZMYFN4oBBYZFj15Jp-HTYoLub4bw2XpNRU,11648
|
31
33
|
janito/cli/prompt_handler.py,sha256=SnPTlL64noeAMGlI08VBDD5IDD8jlVMIYA4-fS8zVLg,215
|
32
34
|
janito/cli/prompt_setup.py,sha256=1s5yccFaWMgDkUjkvnTYGEWJAFPJ6hIiqwbrLfzWxMI,2038
|
@@ -36,7 +38,7 @@ janito/cli/verbose_output.py,sha256=wY_B4of5e8Vv7w1fRwOZzNGU2JqbMdcFnGjtEr4hLus,
|
|
36
38
|
janito/cli/chat_mode/bindings.py,sha256=odjc5_-YW1t2FRhBUNRNoBMoQIg5sMz3ktV7xG0ADFU,975
|
37
39
|
janito/cli/chat_mode/chat_entry.py,sha256=RFdPd23jsA2DMHRacpjAdwI_1dFBaWrtnwyQEgb2fHA,475
|
38
40
|
janito/cli/chat_mode/prompt_style.py,sha256=vsqQ9xxmrYjj1pWuVe9CayQf39fo2EIXrkKPkflSVn4,805
|
39
|
-
janito/cli/chat_mode/script_runner.py,sha256=
|
41
|
+
janito/cli/chat_mode/script_runner.py,sha256=wOwEn4bgmjqHqjTqtfyaSOnRPsGf4ZVW-YAWhEeqxXU,6507
|
40
42
|
janito/cli/chat_mode/session.py,sha256=cqc4Ug3yGA8rR6vFRe5v6U4recqD0tzqgwcf2ASaPgs,12891
|
41
43
|
janito/cli/chat_mode/session_profile_select.py,sha256=CJ2g3VbPGWfBNrNkYYX57oIJZJ-hIZBNGB-zcdjC9vk,5379
|
42
44
|
janito/cli/chat_mode/toolbar.py,sha256=bJ9jPaTInp2gB3yjSVJp8mpNEFiOslzNhVaiqpXJhKc,3025
|
@@ -88,12 +90,14 @@ janito/cli/core/setters.py,sha256=PD3aT1y1q8XWQVtRNfrU0dtlW4JGdn6BMJyP7FCQWhc,46
|
|
88
90
|
janito/cli/core/unsetters.py,sha256=FEw9gCt0vRvoCt0kRSNfVB2tzi_TqppJIx2nHPP59-k,2012
|
89
91
|
janito/cli/single_shot_mode/__init__.py,sha256=Ct99pKe9tINzVW6oedZJfzfZQKWpXz-weSSCn0hrwHY,115
|
90
92
|
janito/cli/single_shot_mode/handler.py,sha256=U70X7c9MHbmj1vQlTI-Ao2JvRprpLbPh9wL5gAMbEhs,3790
|
93
|
+
janito/docs/GETTING_STARTED.md,sha256=EbXV7B3XxjSy1E0XQJFOVITVbTmZBVB7pjth2Mb4_rg,2835
|
94
|
+
janito/docs/PROVIDERS.md,sha256=ZJK6A2j7uA651K5ypDnm-UQsnorCZvcU4qUrBPxpf0Y,4775
|
91
95
|
janito/drivers/dashscope.bak.zip,sha256=9Pv4Xyciju8jO1lEMFVgYXexoZkxmDO3Ig6vw3ODfL8,4936
|
92
96
|
janito/drivers/driver_registry.py,sha256=sbij7R71JJqJVeMfmaU-FKsEuZVO8oEn6Qp8020hdZw,773
|
93
97
|
janito/drivers/openai_responses.bak.zip,sha256=E43eDCHGa2tCtdjzj_pMnWDdnsOZzj8BJTR5tJp8wcM,13352
|
94
|
-
janito/drivers/azure_openai/driver.py,sha256=
|
98
|
+
janito/drivers/azure_openai/driver.py,sha256=rec2D4DDuMjdnbGNIsrnB0oiwuxL_zBykJeUGa-PffI,4074
|
95
99
|
janito/drivers/openai/README.md,sha256=bgPdaYX0pyotCoJ9t3cJbYM-teQ_YM1DAFEKLCMP32Q,666
|
96
|
-
janito/drivers/openai/driver.py,sha256=
|
100
|
+
janito/drivers/openai/driver.py,sha256=7KxJes82SNcuaTMFvG-Avv60FNjg9s3DiynTtocK6Ac,18947
|
97
101
|
janito/event_bus/__init__.py,sha256=VG6GOhKMBh0O_92D-zW8a3YitJPKDajGgPiFezTXlNE,77
|
98
102
|
janito/event_bus/bus.py,sha256=LokZbAdwcWhWOyKSp7H3Ism57x4EZhxlRPjl3NE4UKU,2847
|
99
103
|
janito/event_bus/event.py,sha256=MtgcBPD7cvCuubiLIyo-BWcsNSO-941HLk6bScHTJtQ,427
|
@@ -113,28 +117,28 @@ janito/llm/driver_input.py,sha256=Zq7IO4KdQPUraeIo6XoOaRy1IdQAyYY15RQw4JU30uA,38
|
|
113
117
|
janito/llm/message_parts.py,sha256=QY_0kDjaxdoErDgKPRPv1dNkkYJuXIBmHWNLiOEKAH4,1365
|
114
118
|
janito/llm/model.py,sha256=42hjcffZDTuzjAJoVhDcDqwIXm6rUmmi5UwTOYopf5w,1131
|
115
119
|
janito/llm/provider.py,sha256=3FbhQPrWBSEoIdIi-5DWIh0DD_CM570EFf1NcuGyGko,7961
|
116
|
-
janito/providers/__init__.py,sha256
|
120
|
+
janito/providers/__init__.py,sha256=-FHm_JuCSNGVhF61k9wlzJFxDBnTIl9L28UngTeQVa0,369
|
117
121
|
janito/providers/dashscope.bak.zip,sha256=BwXxRmZreEivvRtmqbr5BR62IFVlNjAf4y6DrF2BVJo,5998
|
118
122
|
janito/providers/registry.py,sha256=Ygwv9eVrTXOKhv0EKxSWQXO5WMHvajWE2Q_Lc3p7dKo,730
|
123
|
+
janito/providers/alibaba/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
124
|
+
janito/providers/alibaba/model_info.py,sha256=oJOTw3yr6SuQItS9ZIAch2AtsKMosgZrdYygPhOSw9s,978
|
125
|
+
janito/providers/alibaba/provider.py,sha256=1sMp02WvtBJMjMtQjpBNUMh_nOsLfHxzz0gbuCCMjqA,4280
|
119
126
|
janito/providers/anthropic/model_info.py,sha256=m6pBh0Ia8_xC1KZ7ke_4HeHIFw7nWjnYVItnRpkCSWc,1206
|
120
|
-
janito/providers/anthropic/provider.py,sha256=
|
127
|
+
janito/providers/anthropic/provider.py,sha256=JS74pDs7gSpwvG0jY-MDO5rljO0JJOffSjaL1LK1YlE,3165
|
121
128
|
janito/providers/azure_openai/model_info.py,sha256=TMSqEpQROIIYUGAyulYJ5xGhj7CbLoaKL_JXeLbXaG0,689
|
122
|
-
janito/providers/azure_openai/provider.py,sha256=
|
129
|
+
janito/providers/azure_openai/provider.py,sha256=lWqHI1JG5c2wl24qFVZwdIW3lBjDwrxAHwskjOGCeWQ,5546
|
123
130
|
janito/providers/deepseek/__init__.py,sha256=4sISEpq4bJO29vxFK9cfnO-SRUmKoD7oSdeCvz0hVno,36
|
124
131
|
janito/providers/deepseek/model_info.py,sha256=tAlFRtWiyNF_MKZ1gy5_-VNlvqoIwAinv6bAv9dNFsc,465
|
125
|
-
janito/providers/deepseek/provider.py,sha256=
|
132
|
+
janito/providers/deepseek/provider.py,sha256=I78wI27Kon4pyTZuO5knhvYejfE1xZysnr36fv_EolQ,4260
|
126
133
|
janito/providers/google/__init__.py,sha256=hE3OGJvLEhvNLhIK_XmCGIdrIj8MKlyGgdOLJ4mdess,38
|
127
134
|
janito/providers/google/model_info.py,sha256=AakTmzvWm1GPvFzGAq6-PeE_Dpq7BmAAqmh3L8N5KKo,1126
|
128
|
-
janito/providers/google/provider.py,sha256=
|
129
|
-
janito/providers/groq/__init__.py,sha256=O0vi5p13DGcDEM3SUQmYB5_g7-UcqT-d0OrrPIsaeD4,36
|
130
|
-
janito/providers/groq/model_info.py,sha256=QBgI4-keoW63sgX8MDhnFN9FHz3F3Oo3gE7XXNkamoM,1612
|
131
|
-
janito/providers/groq/provider.py,sha256=8xUMY_ytSauT5RX3yovS2sDtHX1rkqNwHAEClTaJ7Ls,2697
|
135
|
+
janito/providers/google/provider.py,sha256=4oEaaqFUlGKIw4yTd_0tVWdpAx3QDEIP6cRwmVKDp-I,3760
|
132
136
|
janito/providers/moonshotai/__init__.py,sha256=nThTAtynq4O2Iidm95daKOCKXi5APRJYtRK2Wr3SDpM,31
|
133
|
-
janito/providers/moonshotai/model_info.py,sha256=
|
134
|
-
janito/providers/moonshotai/provider.py,sha256=
|
137
|
+
janito/providers/moonshotai/model_info.py,sha256=MpPAB3tZVvZ8V7tZsiJpk5SReHjVcnwwbp63aUebx9Y,718
|
138
|
+
janito/providers/moonshotai/provider.py,sha256=e3tU6QSPwaquPqSzO4f1HTe3_4eOFB092CSzmoFU8QQ,3984
|
135
139
|
janito/providers/openai/__init__.py,sha256=f0m16-sIqScjL9Mp4A0CQBZx6H3PTEy0cnE08jeaB5U,38
|
136
140
|
janito/providers/openai/model_info.py,sha256=cz08O26Ychm-aP3T8guJRqpR96Im9Cwtgl2iMgM7tJs,3384
|
137
|
-
janito/providers/openai/provider.py,sha256=
|
141
|
+
janito/providers/openai/provider.py,sha256=U9Bp9g2KQ58J6-B5vDgsXM05xASsgaWQOofewC7hiXs,5145
|
138
142
|
janito/providers/openai/schema_generator.py,sha256=hTqeLcPTR8jeKn5DUUpo7b-EZ-V-g1WwXiX7MbHnFzE,2234
|
139
143
|
janito/tools/DOCSTRING_STANDARD.txt,sha256=VLPwNgjxRVD_xZSSVvUZ4H-4bBwM-VKh_RyfzYQsYSs,1735
|
140
144
|
janito/tools/README.md,sha256=5HkLpF5k4PENJER7SlDPRXj0yo9mpHvAHW4uuzhq4ak,115
|
@@ -197,9 +201,9 @@ janito/tools/adapters/local/validate_file_syntax/ps1_validator.py,sha256=TeIkPt0
|
|
197
201
|
janito/tools/adapters/local/validate_file_syntax/python_validator.py,sha256=BfCO_K18qy92m-2ZVvHsbEU5e11OPo1pO9Vz4G4616E,130
|
198
202
|
janito/tools/adapters/local/validate_file_syntax/xml_validator.py,sha256=AijlsP_PgNuC8ZbGsC5vOTt3Jur76otQzkd_7qR0QFY,284
|
199
203
|
janito/tools/adapters/local/validate_file_syntax/yaml_validator.py,sha256=TgyI0HRL6ug_gBcWEm5TGJJuA4E34ZXcIzMpAbv3oJs,155
|
200
|
-
janito-2.
|
201
|
-
janito-2.
|
202
|
-
janito-2.
|
203
|
-
janito-2.
|
204
|
-
janito-2.
|
205
|
-
janito-2.
|
204
|
+
janito-2.10.0.dist-info/licenses/LICENSE,sha256=GSAKapQH5ZIGWlpQTA7v5YrfECyaxaohUb1vJX-qepw,1090
|
205
|
+
janito-2.10.0.dist-info/METADATA,sha256=I8q2g4vGHg3W7ctBlg3u3jSX6RrAR4RJoqOZJdcPBq4,16365
|
206
|
+
janito-2.10.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
207
|
+
janito-2.10.0.dist-info/entry_points.txt,sha256=wIo5zZxbmu4fC-ZMrsKD0T0vq7IqkOOLYhrqRGypkx4,48
|
208
|
+
janito-2.10.0.dist-info/top_level.txt,sha256=m0NaVCq0-ivxbazE2-ND0EA9Hmuijj_OGkmCbnBcCig,7
|
209
|
+
janito-2.10.0.dist-info/RECORD,,
|
@@ -1 +0,0 @@
|
|
1
|
-
from .provider import GroqProvider
|
@@ -1,45 +0,0 @@
|
|
1
|
-
# Groq provider model specifications
|
2
|
-
from janito.llm.model import LLMModelInfo
|
3
|
-
|
4
|
-
MODEL_SPECS = {
|
5
|
-
"moonshotai/kimi-k2-instruct": LLMModelInfo(
|
6
|
-
name="moonshotai/kimi-k2-instruct",
|
7
|
-
context=128000,
|
8
|
-
max_input=122880,
|
9
|
-
max_cot="N/A",
|
10
|
-
max_response=4096,
|
11
|
-
thinking_supported=False,
|
12
|
-
default_temp=0.2,
|
13
|
-
open="groq",
|
14
|
-
driver="GroqModelDriver",
|
15
|
-
other={
|
16
|
-
"description": "Kimi K2 Instruct model by Moonshot AI",
|
17
|
-
"supports_tools": True,
|
18
|
-
"supports_streaming": True,
|
19
|
-
"supports_vision": False,
|
20
|
-
"supports_system_prompt": True,
|
21
|
-
"supports_temperature": True,
|
22
|
-
"supports_top_p": True,
|
23
|
-
"supports_frequency_penalty": True,
|
24
|
-
"supports_presence_penalty": True,
|
25
|
-
"supports_stop_sequences": True,
|
26
|
-
"supports_max_tokens": True,
|
27
|
-
"supports_seed": False,
|
28
|
-
"supports_json_mode": True,
|
29
|
-
"supports_logprobs": False,
|
30
|
-
"supports_top_logprobs": False,
|
31
|
-
"supports_response_format": True,
|
32
|
-
"supports_n": False,
|
33
|
-
"supports_best_of": False,
|
34
|
-
"supports_echo": False,
|
35
|
-
"supports_logit_bias": False,
|
36
|
-
"supports_user": False,
|
37
|
-
"supports_assistant": False,
|
38
|
-
"supports_system": False,
|
39
|
-
"supports_functions": True,
|
40
|
-
"supports_tool_calls": True,
|
41
|
-
"supports_stream_options": False,
|
42
|
-
"supports_include_usage": False,
|
43
|
-
},
|
44
|
-
)
|
45
|
-
}
|
@@ -1,76 +0,0 @@
|
|
1
|
-
from janito.llm.provider import LLMProvider
|
2
|
-
from janito.llm.model import LLMModelInfo
|
3
|
-
from janito.llm.auth import LLMAuthManager
|
4
|
-
from janito.llm.driver_config import LLMDriverConfig
|
5
|
-
from janito.drivers.openai.driver import OpenAIModelDriver
|
6
|
-
from janito.tools import get_local_tools_adapter
|
7
|
-
from janito.providers.registry import LLMProviderRegistry
|
8
|
-
from .model_info import MODEL_SPECS
|
9
|
-
from queue import Queue
|
10
|
-
|
11
|
-
available = OpenAIModelDriver.available
|
12
|
-
unavailable_reason = OpenAIModelDriver.unavailable_reason
|
13
|
-
|
14
|
-
|
15
|
-
class GroqProvider(LLMProvider):
|
16
|
-
name = "groq"
|
17
|
-
NAME = "groq"
|
18
|
-
MAINTAINER = "Groq Inc. <support@groq.com>"
|
19
|
-
MODEL_SPECS = MODEL_SPECS
|
20
|
-
DEFAULT_MODEL = "moonshotai/kimi-k2-instruct"
|
21
|
-
|
22
|
-
def __init__(
|
23
|
-
self, auth_manager: LLMAuthManager = None, config: LLMDriverConfig = None
|
24
|
-
):
|
25
|
-
if not self.available:
|
26
|
-
self._tools_adapter = get_local_tools_adapter()
|
27
|
-
self._driver = None
|
28
|
-
else:
|
29
|
-
self.auth_manager = auth_manager or LLMAuthManager()
|
30
|
-
self._api_key = self.auth_manager.get_credentials(type(self).NAME)
|
31
|
-
self._tools_adapter = get_local_tools_adapter()
|
32
|
-
self._driver_config = config or LLMDriverConfig(model=self.DEFAULT_MODEL)
|
33
|
-
if not self._driver_config.model:
|
34
|
-
self._driver_config.model = self.DEFAULT_MODEL
|
35
|
-
|
36
|
-
if not self._driver_config.api_key:
|
37
|
-
self._driver_config.api_key = self._api_key
|
38
|
-
self._driver_config.base_url = "https://api.groq.com/openai/v1"
|
39
|
-
self.fill_missing_device_info(self._driver_config)
|
40
|
-
self._driver = None
|
41
|
-
|
42
|
-
@property
|
43
|
-
def driver(self) -> OpenAIModelDriver:
|
44
|
-
if not self.available:
|
45
|
-
raise ImportError(f"GroqProvider unavailable: {self.unavailable_reason}")
|
46
|
-
return self._driver
|
47
|
-
|
48
|
-
@property
|
49
|
-
def available(self):
|
50
|
-
return available
|
51
|
-
|
52
|
-
@property
|
53
|
-
def unavailable_reason(self):
|
54
|
-
return unavailable_reason
|
55
|
-
|
56
|
-
def create_driver(self):
|
57
|
-
driver = OpenAIModelDriver(
|
58
|
-
tools_adapter=self._tools_adapter, provider_name=self.NAME
|
59
|
-
)
|
60
|
-
driver.config = self._driver_config
|
61
|
-
return driver
|
62
|
-
|
63
|
-
@property
|
64
|
-
def model_name(self):
|
65
|
-
return self._driver_config.model
|
66
|
-
|
67
|
-
@property
|
68
|
-
def driver_config(self):
|
69
|
-
return self._driver_config
|
70
|
-
|
71
|
-
def execute_tool(self, tool_name: str, event_bus, *args, **kwargs):
|
72
|
-
self._tools_adapter.event_bus = event_bus
|
73
|
-
return self._tools_adapter.execute_by_name(tool_name, *args, **kwargs)
|
74
|
-
|
75
|
-
|
76
|
-
LLMProviderRegistry.register(GroqProvider.NAME, GroqProvider)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|