Skip to content

Commit 68d34ab

Browse files
committed
fix: llm choice working well for openai, anthropic and ollama
1 parent 12b5a83 commit 68d34ab

File tree

9 files changed

+22
-39
lines changed

9 files changed

+22
-39
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,23 @@ Create a `mycoder.config.js` file in your project root:
5959
export default {
6060
// GitHub integration
6161
githubMode: true,
62-
62+
6363
// Browser settings
6464
headless: true,
6565
userSession: false,
6666
pageFilter: 'none', // 'simple', 'none', or 'readability'
67-
67+
6868
// Model settings
6969
provider: 'anthropic',
7070
model: 'claude-3-7-sonnet-20250219',
7171
maxTokens: 4096,
7272
temperature: 0.7,
73-
73+
7474
// Custom settings
7575
customPrompt: '',
7676
profile: false,
7777
tokenCache: true,
78-
78+
7979
// Ollama configuration (if using local models)
8080
ollamaBaseUrl: 'http://localhost:11434',
8181
};

mycoder.config.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ export default {
1111
// Model settings
1212
//provider: 'anthropic',
1313
//model: 'claude-3-7-sonnet-20250219',
14-
provider: 'openai',
15-
model: 'gpt-4o',
14+
//provider: 'openai',
15+
//model: 'gpt-4o',
16+
provider: 'ollama',
17+
model: 'medragondot/Sky-T1-32B-Preview:latest',
1618
maxTokens: 4096,
1719
temperature: 0.7,
1820

packages/agent/src/core/llm/provider.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export function createProvider(
5353
model: string,
5454
options: ProviderOptions = {},
5555
): LLMProvider {
56-
console.log({ providerType, model, options });
5756
const factory = providerFactories[providerType.toLowerCase()];
5857

5958
if (!factory) {

packages/agent/src/core/llm/providers/anthropic.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,6 @@ export class AnthropicProvider implements LLMProvider {
110110
throw new Error('Anthropic API key is required');
111111
}
112112

113-
console.log({
114-
provider: this.provider,
115-
model,
116-
apiKey: this.apiKey,
117-
});
118-
119113
// Initialize Anthropic client
120114
this.client = new Anthropic({
121115
apiKey: this.apiKey,

packages/agent/src/core/llm/providers/openai.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,6 @@ export class OpenAIProvider implements LLMProvider {
5050
throw new Error('OpenAI API key is required');
5151
}
5252

53-
console.log({
54-
provider: this.provider,
55-
model,
56-
apiKey: this.apiKey,
57-
});
58-
5953
// Initialize OpenAI client
6054
this.client = new OpenAI({
6155
apiKey: this.apiKey,

packages/agent/src/utils/errors.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ export const providerConfig: Record<
77
keyName: 'ANTHROPIC_API_KEY',
88
docsUrl: 'https://mycoder.ai/docs/getting-started/anthropic',
99
},
10-
/*
1110
openai: {
1211
keyName: 'OPENAI_API_KEY',
1312
docsUrl: 'https://mycoder.ai/docs/getting-started/openai',
1413
},
15-
xai: {
14+
/*xai: {
1615
keyName: 'XAI_API_KEY',
1716
docsUrl: 'https://mycoder.ai/docs/getting-started/xai',
1817
},

packages/cli/README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ MyCoder includes a GitHub mode that enables the agent to work with GitHub issues
5555
To enable GitHub mode:
5656

5757
1. Via CLI option (overrides config file):
58+
5859
```bash
5960
mycoder --githubMode true
6061
```
6162

6263
2. Via configuration file:
64+
6365
```js
6466
// mycoder.config.js
6567
export default {
@@ -71,11 +73,13 @@ export default {
7173
To disable GitHub mode:
7274

7375
1. Via CLI option:
76+
7477
```bash
7578
mycoder --githubMode false
7679
```
7780

7881
2. Via configuration file:
82+
7983
```js
8084
// mycoder.config.js
8185
export default {
@@ -158,7 +162,7 @@ Or in your configuration file:
158162
export default {
159163
// Model settings
160164
provider: 'anthropic',
161-
model: 'claude-3-7-sonnet-20250219', // or any other Anthropic model
165+
model: 'claude-3-7-sonnet-20250219', // or any other Anthropic model
162166
// other configuration options...
163167
};
164168
```
@@ -186,14 +190,15 @@ Example configuration in `mycoder.config.js`:
186190
// mycoder.config.js
187191
export default {
188192
// Browser settings
189-
headless: false, // Show browser UI
190-
userSession: true, // Use existing browser session
191-
pageFilter: 'readability', // Use readability for webpage processing
192-
193+
headless: false, // Show browser UI
194+
userSession: true, // Use existing browser session
195+
pageFilter: 'readability', // Use readability for webpage processing
196+
193197
// Custom settings
194-
customPrompt: "Always prioritize readability and simplicity in your code. Prefer TypeScript over JavaScript when possible.",
195-
tokenCache: false, // Disable token caching for LLM API calls
196-
198+
customPrompt:
199+
'Always prioritize readability and simplicity in your code. Prefer TypeScript over JavaScript when possible.',
200+
tokenCache: false, // Disable token caching for LLM API calls
201+
197202
// Other configuration options...
198203
};
199204
```

packages/cli/src/commands/$default.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,6 @@ export const command: CommandModule<SharedOptions, DefaultArgs> = {
155155
temperature: config.temperature,
156156
};
157157

158-
console.log('agentConfig', agentConfig);
159-
160158
const result = await toolAgent(prompt, tools, agentConfig, {
161159
logger,
162160
headless: config.headless,

packages/cli/src/settings/config.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,26 +93,18 @@ export async function loadConfig(
9393
searchStrategy: 'global',
9494
});
9595

96-
console.log({ cwd: process.cwd() });
97-
9896
// Search for configuration file
9997
const result = await explorer.search();
100-
console.log({ explorerResult: result });
10198

10299
// Merge configurations with precedence: default < file < cli
103100
const fileConfig = result?.config || {};
104101

105-
console.log({ defaultConfig });
106-
console.log({ fileConfig });
107-
console.log({ cliOptions });
108-
109102
// Return merged configuration
110103
const mergedConfig = {
111104
...defaultConfig,
112105
...removeUndefined(fileConfig),
113106
...removeUndefined(cliOptions),
114107
};
115-
console.log({ mergedConfig });
116108
return mergedConfig;
117109
}
118110

0 commit comments

Comments
 (0)