-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: client github loads github info via messages #232
feat: client github loads github info via messages #232
Conversation
…er action from client
Here are the recent user messages for context: | ||
{{recentMessages}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should actually just use message and get the latest message so it is easier feel free to add the latest message to the state before composing the context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monilpat depends because we can have multiple messages that got posted by the user by the time the action is triggered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it lets include both the latest message {{message}} and the {{ recentMessages}} as I have found it improves the output
export const ConfigGithubInfoSchema = z.object({ | ||
owner: z.string().min(1, "GitHub owner is required"), | ||
repo: z.string().min(1, "GitHub repo is required"), | ||
branch: z.string().min(1, "GitHub branch is required"), | ||
}); | ||
|
||
export interface ConfigGithubInfoContent { | ||
owner: string; | ||
repo: string; | ||
branch: string; | ||
} | ||
|
||
export const isConfigGithubInfoContent = ( | ||
object: any | ||
): object is ConfigGithubInfoContent => { | ||
if (ConfigGithubInfoSchema.safeParse(object).success) { | ||
return true; | ||
} | ||
elizaLogger.error("Invalid content: ", object); | ||
return false; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same for these
} else { | ||
state = await runtime.updateRecentMessageState(state); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can add it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI #232 (comment)
if (!state) { | ||
state = (await runtime.composeState(message)) as State; | ||
} else { | ||
state = await runtime.updateRecentMessageState(state); | ||
} | ||
const updatedState = await incorporateRepositoryState( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI #232 (comment)
@@ -655,77 +433,16 @@ export async function incorporateRepositoryState( | |||
// TODO: | |||
// We need to actually save goals, knowledge,facts, we only save memories for now | |||
// We need to dynamically update the goals, knoweldge, facts, bio, lore, we should add actions to update these and chain them to the OODA cycle | |||
const owner = runtime.getSetting("GITHUB_OWNER") ?? ("" as string); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did we remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monilpat to clarify this function is not used anymore as most of its logic got moved away to the github client, actions are using the same github client’s state therefore they don’t need to incorporate repo state anymore
@@ -11,24 +11,48 @@ import { | |||
UUID, | |||
generateObject, | |||
stringToUuid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind explaining the changes thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monilpat sure thing
- we have 3 separate stages now that trigger various loops: github info discovery loop, repo init loop and OODA loop
- the github info discovery loop waits for getting the github info available in the context so it can save them to the state
- the repo init loop process both init repo and memorize actions along with adding both existing issues and PRs to memory, it waits for getting the list of repo files available in memory
- the OODA loop waits for a new action to be available (other action than NOTHING) and if so create a new action memory and process the action and move to the next cycle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool makes sense thanks for clarifying :)
Relates to
#199
Risks
Low
Background
What does this PR do?
What kind of change is this?
Features
Documentation changes needed?
Testing
Where should a reviewer start?
Detailed testing steps
Screen.Recording.2025-01-14.at.20.11.57.mov