symposium 0.4.0 → 0.4.1
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/models/AnthropicModel.js +25 -0
- package/models/Claude3Haiku.js +7 -0
- package/models/Claude3Opus.js +7 -0
- package/models/Claude3Sonnet.js +7 -0
- package/models/Gpt4.js +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import Model from "../Model.js";
|
|
2
|
+
import Anthropic from '@anthropic-ai/sdk';
|
|
3
|
+
|
|
4
|
+
export default class AnthropicModel extends Model {
|
|
5
|
+
anthropic;
|
|
6
|
+
supports_tools = false;
|
|
7
|
+
|
|
8
|
+
getAnthropic() {
|
|
9
|
+
if (!this.anthropic)
|
|
10
|
+
this.anthropic = new Anthropic({apiKey: process.env.ANTHROPIC_API_KEY});
|
|
11
|
+
|
|
12
|
+
return this.anthropic;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async generate(thread, payload = {}, functions = []) {
|
|
16
|
+
const completion_payload = {
|
|
17
|
+
model: this.name,
|
|
18
|
+
messages: thread.getMessagesJson(),
|
|
19
|
+
...payload,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const message = await this.getAnthropic().messages.create(completion_payload);
|
|
23
|
+
return message.content;
|
|
24
|
+
}
|
|
25
|
+
}
|
package/models/Gpt4.js
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "symposium",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.1",
|
|
5
5
|
"description": "Agents",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"author": "Domenico Giambra",
|
|
8
8
|
"license": "ISC",
|
|
9
9
|
"dependencies": {
|
|
10
|
+
"@anthropic-ai/sdk": "^0.19.1",
|
|
10
11
|
"@travio/redis": "^2.0.0",
|
|
11
12
|
"openai": "^4.12.1",
|
|
12
13
|
"tiktoken": "^1.0.10"
|