Skip to content

Commit

Permalink
fix: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
snobbee committed Nov 27, 2024
1 parent 67d4d3f commit 4b1b42f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 2 additions & 7 deletions packages/plugin-github/src/plugins/createCommit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from "path";
import { composeContext, elizaLogger, generateObjectV2, Action, HandlerCallback, IAgentRuntime, Memory, ModelClass, Plugin, State } from "@ai16z/eliza";
import { createCommitTemplate } from "../templates";
import { CreateCommitContent, CreateCommitSchema, isCreateCommitContent } from "../types";
import { commitAndPushChanges, writeFiles } from "../utils";
import { commitAndPushChanges, getRepoPath, writeFiles } from "../utils";

export const createCommitAction: Action = {
name: "CREATE_COMMIT",
Expand Down Expand Up @@ -42,12 +42,7 @@ export const createCommitAction: Action = {

elizaLogger.info("Committing changes to the repository...");

const repoPath = path.join(
process.cwd(),
".repos",
content.owner,
content.repo,
);
const repoPath = getRepoPath(content.owner, content.repo);

try {
await writeFiles(repoPath, content.files);
Expand Down
9 changes: 2 additions & 7 deletions packages/plugin-github/src/plugins/createMemoriesFromFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createHash } from "crypto";
import { composeContext, elizaLogger, generateObjectV2, knowledge, stringToUuid, Action, HandlerCallback, IAgentRuntime, Memory, ModelClass, Plugin, State } from "@ai16z/eliza";
import { createMemoriesFromFilesTemplate } from "../templates";
import { CreateMemoriesFromFilesContent, CreateMemoriesFromFilesSchema, isCreateMemoriesFromFilesContent } from "../types";
import { retrieveFiles } from "../utils";
import { getRepoPath, retrieveFiles } from "../utils";

export async function addFilesToMemory(runtime: IAgentRuntime, files: string[], repoPath: string, owner: string, repo: string) {
for (const file of files) {
Expand Down Expand Up @@ -89,12 +89,7 @@ export const createMemoriesFromFilesAction: Action = {

elizaLogger.info("Creating memories from files...");

const repoPath = path.join(
process.cwd(),
".repos",
content.owner,
content.repo,
);
const repoPath = getRepoPath(content.owner, content.repo);

try {
const files = await retrieveFiles(repoPath, content.path);
Expand Down

0 comments on commit 4b1b42f

Please sign in to comment.