modelmix 1.1.8 → 1.2.0
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.
- package/README.md +11 -10
- package/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,10 +90,6 @@ Here's a quick example to get you started:
|
|
|
90
90
|
|
|
91
91
|
## 📚 ModelMix Class Overview
|
|
92
92
|
|
|
93
|
-
#### ModelMix
|
|
94
|
-
|
|
95
|
-
**Constructor**
|
|
96
|
-
|
|
97
93
|
```javascript
|
|
98
94
|
new ModelMix(args = { options: {}, config: {} })
|
|
99
95
|
```
|
|
@@ -107,6 +103,7 @@ new ModelMix(args = { options: {}, config: {} })
|
|
|
107
103
|
- `system`: Sets the default system message for the model, e.g., "You are an assistant."
|
|
108
104
|
- `max_history`: Limits the number of historical messages to retain, e.g., 5.
|
|
109
105
|
- `max_request`: Limits the number of parallel request.
|
|
106
|
+
- ...
|
|
110
107
|
|
|
111
108
|
**Methods**
|
|
112
109
|
|
|
@@ -125,8 +122,6 @@ new ModelMix(args = { options: {}, config: {} })
|
|
|
125
122
|
|
|
126
123
|
#### OpenAIModel
|
|
127
124
|
|
|
128
|
-
**Constructor**
|
|
129
|
-
|
|
130
125
|
```javascript
|
|
131
126
|
new OpenAIModel(openai, args = { options: {}, config: {} })
|
|
132
127
|
```
|
|
@@ -136,8 +131,6 @@ new OpenAIModel(openai, args = { options: {}, config: {} })
|
|
|
136
131
|
|
|
137
132
|
#### AnthropicModel
|
|
138
133
|
|
|
139
|
-
**Constructor**
|
|
140
|
-
|
|
141
134
|
```javascript
|
|
142
135
|
new AnthropicModel(anthropic, args = { options: {}, config: {} })
|
|
143
136
|
```
|
|
@@ -147,13 +140,21 @@ new AnthropicModel(anthropic, args = { options: {}, config: {} })
|
|
|
147
140
|
|
|
148
141
|
#### CustomModel
|
|
149
142
|
|
|
150
|
-
**Constructor**
|
|
151
|
-
|
|
152
143
|
```javascript
|
|
153
144
|
new CustomModel(args = { config: {}, options: {} })
|
|
154
145
|
```
|
|
155
146
|
|
|
156
147
|
- **args**: Configuration object with `config` and `options` properties.
|
|
148
|
+
- **config**:
|
|
149
|
+
- `url`:
|
|
150
|
+
- `bearer`:
|
|
151
|
+
- `prefix`:
|
|
152
|
+
- ...
|
|
153
|
+
- **options**: This object contains default options that are applied to all models. These options can be overridden when creating a specific model instance. Examples of default options include:
|
|
154
|
+
- `max_tokens`: Sets the maximum number of tokens to generate, e.g., 2000.
|
|
155
|
+
- `temperature`: Controls the randomness of the model's output, e.g., 1.
|
|
156
|
+
- `top_p`: Controls the diversity of the output, e.g., 1.
|
|
157
|
+
- ...
|
|
157
158
|
|
|
158
159
|
## 🤝 Contributing
|
|
159
160
|
|
package/index.js
CHANGED
|
@@ -28,7 +28,7 @@ class ModelMix {
|
|
|
28
28
|
modelInstance.active_requests = 0;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
create(modelKey, overOptions = {}) {
|
|
31
|
+
async create(modelKey, overOptions = {}) {
|
|
32
32
|
const modelEntry = Object.values(this.models).find(entry =>
|
|
33
33
|
entry.config.prefix.some(p => modelKey.startsWith(p))
|
|
34
34
|
);
|