Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

email/models/proxy Next => Prod #19

Merged
merged 10 commits into from
Feb 25, 2025
2 changes: 1 addition & 1 deletion packages/client-discord/src/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ export class MessageManager {
const response = await generateShouldRespond({
runtime: this.runtime,
context: shouldRespondContext,
modelClass: ModelClass.LARGE,
modelClass: ModelClass.SMALL,
});

if (response === "RESPOND") {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-discord/src/voice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ export class VoiceManager extends EventEmitter {
const response = await generateShouldRespond({
runtime: this.runtime,
context: shouldRespondContext,
modelClass: ModelClass.LARGE,
modelClass: ModelClass.SMALL,
});

if (response === "RESPOND") {
Expand Down
2 changes: 1 addition & 1 deletion packages/client-telegram/src/messageManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ export class MessageManager {
const response = await generateShouldRespond({
runtime: this.runtime,
context: shouldRespondContext,
modelClass: ModelClass.LARGE,
modelClass: ModelClass.SMALL,
});

return response === "RESPOND";
Expand Down
7 changes: 3 additions & 4 deletions packages/client-twitter/src/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
} from "agent-twitter-client";
import { EventEmitter } from "events";
import type { TwitterConfig } from "./environment.ts";
import { Agent, fetch, ProxyAgent, setGlobalDispatcher } from "undici";
import { Agent, fetch as undiciFetch, ProxyAgent, setGlobalDispatcher } from "undici";

export function extractAnswer(text: string): string {
const startIndex = text.indexOf("Answer: ") + 8;
Expand Down Expand Up @@ -120,7 +120,6 @@ function doLogin(username, cb, proxyUrl?: string, localAddress?: string) {
`${username}:${password}`
).toString("base64")}`;
}

proxyAgent = new ProxyAgent(agentOptions);
}
if (localAddress) {
Expand All @@ -131,10 +130,10 @@ function doLogin(username, cb, proxyUrl?: string, localAddress?: string) {
}
try {
const twitterClient = new Scraper({
fetch: fetch,
fetch: undiciFetch,
transform: {
request: (input: any, init: any) => {
if (agent) {
if (proxyAgent || agent) {
return [
input,
{ ...init, dispatcher: proxyAgent ?? agent },
Expand Down
4 changes: 2 additions & 2 deletions packages/client-twitter/src/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ export class TwitterInteractionClient {
const shouldRespond = await generateShouldRespond({
runtime: this.runtime,
context: shouldRespondContext,
modelClass: ModelClass.LARGE,
modelClass: ModelClass.SMALL,
});

// Promise<"RESPOND" | "IGNORE" | "STOP" | null> {
Expand Down Expand Up @@ -693,4 +693,4 @@ export class TwitterInteractionClient {

return thread;
}
}
}
2 changes: 1 addition & 1 deletion packages/client-twitter/src/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,7 @@ export class TwitterPostClient {
const actionResponse = await generateTweetActions({
runtime: this.runtime,
context: actionContext,
modelClass: ModelClass.LARGE,
modelClass: ModelClass.SMALL,
});

if (!actionResponse) {
Expand Down
Loading
Loading