Skip to content

Commit

Permalink
updates to local ai provider and tee
Browse files Browse the repository at this point in the history
  • Loading branch information
lalalune committed Feb 11, 2025
1 parent 7fc0640 commit 75ab478
Show file tree
Hide file tree
Showing 15 changed files with 632 additions and 208 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions packages/agent/src/defaultCharacter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const defaultCharacter: Character = {
plugins: [
"@elizaos/plugin-anthropic",
"@elizaos/plugin-openai",
"@elizaos/plugin-local-ai",
"@elizaos/plugin-discord",
"@elizaos/plugin-node",
"@elizaos/plugin-telegram",
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/knowledge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ async function get(
runtime: AgentRuntime,
message: Memory
): Promise<KnowledgeItem[]> {
console.log("get", message);
// Add validation for message
if (!message?.content?.text) {
logger.warn("Invalid message for knowledge query:", {
Expand Down Expand Up @@ -69,6 +70,7 @@ async function set(
chunkSize = 512,
bleed = 20
) {
console.log("set", item);
const embedding = await runtime.useModel(ModelClass.TEXT_EMBEDDING, null);
await runtime.documentsManager.createMemory({
id: item.id,
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class MemoryManager implements IMemoryManager {
* @throws Error if the memory content is empty
*/
async addEmbeddingToMemory(memory: Memory): Promise<Memory> {
console.log("addEmbeddingToMemory", memory);
// Return early if embedding already exists
if (memory.embedding) {
return memory;
Expand Down Expand Up @@ -173,6 +174,7 @@ export class MemoryManager implements IMemoryManager {
*/
async createMemory(memory: Memory, unique = false): Promise<void> {
// TODO: check memory.agentId == this.runtime.agentId
console.log("createMemory", memory);

const existingMessage =
await this.runtime.databaseAdapter.getMemoryById(memory.id);
Expand Down
2 changes: 2 additions & 0 deletions packages/plugin-bootstrap/src/providers/facts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { formatFacts } from "../evaluators/fact.ts";
const factsProvider: Provider = {
get: async (runtime: IAgentRuntime, message: Memory, state?: State) => {
const recentMessagesData = state?.recentMessagesData?.slice(-10);
console.log("get", message);


const recentMessages = formatMessages({
messages: recentMessagesData,
Expand Down
Loading

0 comments on commit 75ab478

Please sign in to comment.