Skip to content

Commit 63ac45a

Browse files
author
mike dupont
committed
wip
1 parent 16e56af commit 63ac45a

File tree

5 files changed

+587
-59
lines changed

5 files changed

+587
-59
lines changed

.github/workflows/Readme.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Secrets used
2+
- OPENAI_API_KEY
3+
- TURBO_TOKEN
4+
- TURBO_TEAM
5+
- NODE_AUTH_TOKEN
6+
7+
# fixme: why 4 different gihthub tokens?
8+
- GH_PAT
9+
- GITHUB_ACCESS_TOKEN
10+
- GITHUB_TOKEN
11+
- CHANGELOG_GITHUB_TOKEN

delete.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
set -e
3+
# Delete all images in a repository
4+
# Usage: ./delete.sh <repository-name>
5+
# Example: ./delete.sh agent/eliza
6+
# Note: This script will not delete the repository itself, only the images in it
7+
8+
9+
if [ -z "$1" ]; then
10+
echo "Error: Repository name is required."
11+
echo "Usage: ./delete.sh <repository-name>"
12+
exit 1
13+
fi
14+
15+
echo "Deleting all images in repository: $1"
16+
aws ecr batch-delete-image \
17+
--repository-name "$1" \
18+
--image-ids "$(aws ecr list-images --repository-name "$1" --query 'imageIds[*]' --output json)" || true
19+
echo "Deletion process completed."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

scripts/jsdoc-automation/src/AIService/AIService.ts

+27-59
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,25 @@ import dotenv from "dotenv";
22
const de = dotenv.config();
33
console.log("DEBUG",de)
44

5+
const logFetch = async (url: string, options: any) => {
6+
console.debug(`Fetching ${url}`);
7+
// Disabled to avoid disclosure of sensitive information such as API keys
8+
// elizaLogger.debug(JSON.stringify(options, null, 2));
9+
return fetch(url, options);
10+
};
11+
12+
import { bootstrapPlugin } from "@elizaos/plugin-bootstrap";
13+
514
if (de.error) {
615
throw de.error;
716
}
817

918
import { defaultCharacter } from "../defaultCharacter.js";
1019
import {
1120

12-
// type Adapter,
21+
1322
AgentRuntime,
23+
1424
// CacheManager,
1525
// CacheStore,
1626
composeContext,
@@ -38,6 +48,7 @@ import {
3848
// settings,
3949
stringToUuid,
4050
getEmbeddingZeroVector,
51+
composeActionExamples,
4152
// validateCharacterConfig,
4253
} from "@elizaos/core";
4354
//import { defaultCharacter } from "./defaultCharacter.ts";
@@ -166,6 +177,7 @@ export class AIService {
166177
private chatModelFAQ: ChatWrapper;// <ChatOpenAICallOptions>
167178
//runtime: AgentRuntime;
168179
private agents: Map<string, IAgentRuntime>; // container management
180+
runtime: AgentRuntime;
169181

170182
/**
171183
* Constructor for initializing the ChatOpenAI instance.
@@ -202,7 +214,18 @@ export class AIService {
202214
this.codeFormatter = new CodeFormatter();
203215

204216
this.agents = new Map();
205-
// this.runtime = {
217+
const token = "token";
218+
const character = defaultCharacter;
219+
this.runtime = new AgentRuntime({token,
220+
modelProvider: character.modelProvider,
221+
evaluators: [],
222+
character,
223+
// character.plugins are handled when clients are added
224+
plugins: [bootstrapPlugin].flat().filter(Boolean),
225+
providers: [],
226+
managers: [],
227+
fetch: logFetch,})
228+
//{
206229
// agentId: "00000000-0000-0000-0000-000000000000",
207230
// serverUrl: "http://localhost",
208231
// databaseAdapter: {} as IDatabaseAdapter,
@@ -294,55 +317,7 @@ export class AIService {
294317
this.handleAPIError(error as Error);
295318
return "";
296319
}
297-
return "";
298-
// try {
299-
// try {
300-
// let response;
301-
// if (isFAQ) {
302-
// response = await this.chatModelFAQ.invoke(finalPrompt);
303-
// } else {
304-
// response = await this.chatModel.invoke(finalPrompt);
305-
// }
306-
// return response.content as string;
307-
// } catch (error) {
308-
// if (
309-
// error instanceof Error &&
310-
// error.message.includes("maximum context length")
311-
// ) {
312-
// console.warn(
313-
// "Token limit exceeded, attempting with further truncation..."
314-
// );
315-
// // Try with more aggressive truncation
316-
// finalPrompt = this.codeFormatter.truncateCodeBlock(prompt, 4000);
317-
// try {
318-
// const response =
319-
// await this.chatModel.invoke(finalPrompt);
320-
// return response.content as string;
321-
// } catch (retryError) {
322-
// if (
323-
// retryError instanceof Error &&
324-
// retryError.message.includes(
325-
// "maximum context length"
326-
// )
327-
// ) {
328-
// console.warn(
329-
// "Still exceeding token limit, using minimal context..."
330-
// );
331-
// // Final attempt with minimal context
332-
// finalPrompt = this.codeFormatter.truncateCodeBlock(prompt, 2000);
333-
// const response =
334-
// await this.chatModel.invoke(finalPrompt);
335-
// return response.content as string;
336-
// }
337-
// throw retryError;
338-
// }
339-
// }
340-
// throw error;
341-
// }
342-
// } catch (error) {
343-
// this.handleAPIError(error as Error);
344-
// return "";
345-
// }
320+
return "";
346321
}
347322

348323
/**
@@ -357,16 +332,9 @@ export class AIService {
357332
throw error;
358333
}
359334
}
360-
//function processChunk(finalPrompt: string, arg1: string, runtime: any) {
361-
//throw new Error("Function not implemented.");
362-
//}
363-
364-
365-
366-
367-
//import getTokenForProvider from "../index.ts"
368335

369336
async function processChunk(prompt: string, manager: string, runtime: IAgentRuntime): Promise<string> {
337+
console.log("process chunk");
370338
try {
371339
const mm = runtime.getMemoryManager(manager);
372340
if (!mm) {

0 commit comments

Comments
 (0)