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

feat: add only to booleanFooter #1437

Merged
merged 2 commits into from
Dec 24, 2024

Conversation

fyInALT
Copy link
Contributor

@fyInALT fyInALT commented Dec 24, 2024

Relates to:

Risks

medium

Background

When use llama3.1:8b as OLLAMA_MODEL, when use booleanFooter, it will return not just YES or NO, like:

Use context:

   {"context":"# Task: Decide if the recent messages should be processed for token recommendations.

    Look for messages that:

    ...  

    Should the messages be processed for recommendations? Respond with a YES or a NO."} 

and will return:

   {"response":"YES 

There are several instances in this conversation where users ask to create tokens, send Solana coins, and discuss token-related topics. The keyword \"token\" is mentioned multiple times, indicating that these conversations should be processed for token recommendation."} 

It will make the match in parseBooleanFromText return null, then make generateTrueOrFalse call blocked by

while (true) {
    try {
      const response = await generateText({
        stop,
        runtime,
        context,
        modelClass
      });
      const parsedResponse = parseBooleanFromText(response.trim());
      if (parsedResponse !== null) {
        return parsedResponse;
      }
    } catch (error) {
      elizaLogger.error("Error in generateTrueOrFalse:", error);
    }
}

So that the eliza will keep retry to got the response.

It can fixed by add a only in booleanFooter. Then it will only return YES or NO

What does this PR do?

This PR change booleanFooter to:

Respond with only a YES or a NO.

What kind of change is this?

Bug fixes

Documentation changes needed?

No

Testing

Where should a reviewer start?

Detailed testing steps

@fyInALT fyInALT changed the base branch from main to develop December 24, 2024 16:01
@monilpat monilpat merged commit 9d2545c into elizaOS:develop Dec 24, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants