Skip to content

Commit

Permalink
Remove option
Browse files Browse the repository at this point in the history
  • Loading branch information
arshad-yaseen committed Sep 26, 2024
1 parent 4f03147 commit 3bb5e67
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 38 deletions.
12 changes: 0 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
- [Max Context Lines](#max-context-lines)
- [Copilot Options](#copilot-options)
- [Changing the Provider and Model](#changing-the-provider-and-model)
- [Updating Provider and Model at Runtime](#updating-provider-and-model-at-runtime)
- [Custom Model](#custom-model)
- [Completion Request Options](#completion-request-options)
- [Custom Headers](#custom-headers)
Expand Down Expand Up @@ -276,17 +275,6 @@ There are other providers and models available. Here is a list:
| OpenAI | `gpt-4o`, `gpt-4o-mini`, `o1-preview`, `o1-mini` |
| Anthropic | `claude-3.5-Sonnet`, `claude-3-opus`, `claude-3-sonnet`, `claude-3-haiku` |

#### Updating Provider and Model at Runtime

You can change the provider and model at runtime using the `setModel` method.

```javascript
copilot.setModel({
provider: 'anthropic',
model: 'claude-3-haiku',
});
```

### Custom Model

You can use a custom AI model that isn't built into Monacopilot by setting up a `model` when you create a new Copilot. This feature lets you connect to AI models from other services or your own custom-built models.
Expand Down
11 changes: 0 additions & 11 deletions src/classes/copilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
CopilotOptions,
CopilotProvider,
CustomCopilotModel,
SetModelOptions,
} from '../types';
import {HTTP, joinWithAnd} from '../utils';

Expand Down Expand Up @@ -146,14 +145,4 @@ export class Copilot {
return {error: errorDetails.message, completion: null};
}
}

/**
* Sets the model and provider for the Copilot.
* @param options - The options for setting the model and provider.
*/
public setModel({model, provider}: SetModelOptions): void {
this.model = model;
this.provider = provider;
this.validateInputs();
}
}
15 changes: 0 additions & 15 deletions src/types/copilot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,6 @@ export type CustomCopilotModel = {
transformResponse: CustomCopilotModelTransformResponse;
};

export type SetModelOptions = {
/**
* The provider to set (e.g., 'openai', 'anthropic', 'groq').
*/
provider: CopilotProvider;
/**
* The model to use for copilot AI requests.
* This can be either:
* 1. A predefined model name (e.g. 'claude-3-opus'): Use this option if you want to use a model that is built into Monacopilot.
* If you choose this option, also set the `provider` property to the corresponding provider of the model.
* 2. A custom model configuration object: Use this option if you want to use a AI model from a third-party service or your own custom model.
*/
model: CopilotModel | CustomCopilotModel;
};

export type CustomCopilotModelConfig = (
apiKey: string,
prompt: {
Expand Down

0 comments on commit 3bb5e67

Please sign in to comment.