create-message-kit 1.1.7-beta.10 → 1.1.7-beta.12
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -4,23 +4,15 @@ import { agent_prompt } from "./prompt.js";
|
|
4
4
|
import { getUserInfo } from "@xmtp/message-kit";
|
5
5
|
|
6
6
|
run(async (context: HandlerContext) => {
|
7
|
-
/*All the skills are handled through the skills file*/
|
8
|
-
/* If its just text, it will be handled by the ensAgent*/
|
9
|
-
/* If its a group message, it will be handled by the groupAgent*/
|
10
|
-
if (!process?.env?.OPEN_AI_API_KEY) {
|
11
|
-
console.warn("No OPEN_AI_API_KEY found in .env");
|
12
|
-
return;
|
13
|
-
}
|
14
|
-
|
15
7
|
const {
|
16
8
|
message: {
|
17
|
-
content: {
|
9
|
+
content: { text, params },
|
18
10
|
sender,
|
19
11
|
},
|
20
12
|
} = context;
|
21
13
|
|
22
14
|
try {
|
23
|
-
let userPrompt = params?.prompt ??
|
15
|
+
let userPrompt = params?.prompt ?? text;
|
24
16
|
const userInfo = await getUserInfo(sender.address);
|
25
17
|
if (!userInfo) {
|
26
18
|
console.log("User info not found");
|
@@ -2,11 +2,6 @@ import { HandlerContext, AbstractedMember } from "@xmtp/message-kit";
|
|
2
2
|
import { textGeneration } from "@xmtp/message-kit";
|
3
3
|
|
4
4
|
export async function handler(context: HandlerContext) {
|
5
|
-
if (!process?.env?.OPEN_AI_API_KEY) {
|
6
|
-
console.warn("No OPEN_AI_API_KEY found in .env");
|
7
|
-
return;
|
8
|
-
}
|
9
|
-
|
10
5
|
const {
|
11
6
|
message: {
|
12
7
|
sender,
|