Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/bino-dev' into bino
Browse files Browse the repository at this point in the history
  • Loading branch information
nicky-ru committed Feb 5, 2025
2 parents 7f60eae + 137471e commit be4080e
Show file tree
Hide file tree
Showing 9 changed files with 245 additions and 132 deletions.
2 changes: 1 addition & 1 deletion packages/client-discord/src/attachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ async function generateSummary(
"summary": "Generated summary and/or description of the text"
}
</response>
\`\`\``;
`;

const response = await generateText({
runtime,
Expand Down
16 changes: 0 additions & 16 deletions packages/client-discord/src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1250,22 +1250,6 @@ export class MessageManager {
runtime: this.runtime,
context: shouldRespondContext,
modelClass: ModelClass.SMALL,
// @ts-ignore
messages: this.runtime.idealOutputs?.shouldRespondTemplate
? [
{
role: "user",
content: [
{
type: "text",
// @ts-ignore
text: this.runtime.idealOutputs
?.shouldRespondTemplate,
},
],
},
]
: undefined,
});

if (parsedResponse === "RESPOND") {
Expand Down
16 changes: 0 additions & 16 deletions packages/client-telegram/src/messageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -666,22 +666,6 @@ export class MessageManager {
runtime: this.runtime,
context: shouldRespondContext,
modelClass: ModelClass.SMALL,
// @ts-ignore
messages: this.runtime.idealOutputs?.shouldRespondTemplate
? [
{
role: "user",
content: [
{
type: "text",
// @ts-ignore
text: this.runtime.idealOutputs
?.shouldRespondTemplate,
},
],
},
]
: undefined,
});

return response === "RESPOND";
Expand Down
15 changes: 0 additions & 15 deletions packages/client-twitter/src/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,21 +429,6 @@ export class TwitterInteractionClient {
runtime: this.runtime,
context: shouldRespondContext,
modelClass: ModelClass.SMALL,
// @ts-ignore
messages: this.runtime.idealOutputs?.twitterShouldRespondTemplate
? [
{
role: "user",
content: [
{
type: "text",
// @ts-ignore
text: this.runtime.idealOutputs?.twitterShouldRespondTemplate,
},
],
},
]
: undefined,
});

// Promise<"RESPOND" | "IGNORE" | "STOP" | null> {
Expand Down
9 changes: 2 additions & 7 deletions packages/core/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ export async function generateShouldRespond({
runtime,
context,
modelClass,
messages
messages,
});

const extractedResponse = parseTagContent(response, "response");
Expand Down Expand Up @@ -2074,7 +2074,6 @@ async function handleAnthropic({
schema,
schemaName,
schemaDescription,
mode = "json",
modelOptions,
runtime,
}: ProviderOptions): Promise<GenerateObjectResult<unknown>> {
Expand All @@ -2088,7 +2087,6 @@ async function handleAnthropic({
schema,
schemaName,
schemaDescription,
mode,
...modelOptions,
});
}
Expand Down Expand Up @@ -2340,10 +2338,7 @@ export async function generateTweetActions({
context,
modelClass,
});
console.debug(
"Received response from generateText for tweet actions:",
response
);

const parsedResponse = parseTagContent(response, "response");
const { actions } = parseActionResponseFromText(parsedResponse);
if (actions) {
Expand Down
1 change: 0 additions & 1 deletion packages/plugin-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"formdata-node": "6.0.3",
"fs-extra": "11.2.0",
"gaxios": "6.7.1",
"gif-frames": "0.4.1",
"glob": "11.0.0",
"graceful-fs": "4.2.11",
"html-escaper": "3.0.3",
Expand Down
10 changes: 8 additions & 2 deletions packages/plugin-node/src/actions/describe-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,18 @@ export const describeImage: Action = {
stop: ["\n"],
});

if (!isFileLocationResult(fileLocationResultObject?.object)) {
if (
!isFileLocationResult(
fileLocationResultObject?.object ?? fileLocationResultObject
)
) {
elizaLogger.error("Failed to generate file location");
return false;
}

const { fileLocation } = fileLocationResultObject.object;
let fileLocation = (fileLocationResultObject?.object as any)
?.fileLocation;
fileLocation ??= fileLocationResultObject;

const { description } = await runtime
.getService<IImageDescriptionService>(ServiceType.IMAGE_DESCRIPTION)
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
VideoService,
AwsS3Service,
} from "./services/index.ts";
import { describeImage } from "./actions/describe-image.ts";
// import { describeImage } from "./actions/describe-image.ts";

export type NodePlugin = ReturnType<typeof createNodePlugin>;

Expand All @@ -30,6 +30,6 @@ export function createNodePlugin() {
new VideoService(),
new AwsS3Service(),
],
actions: [describeImage],
actions: [],
} as const satisfies Plugin;
}
Loading

0 comments on commit be4080e

Please sign in to comment.