Skip to content

Conversation

@google-labs-jules
Copy link
Contributor

This PR enhances the bot's default behavior when no command is specified.

  1. Routing Logic: Instead of always defaulting to GetBiblePassage, the bot now analyzes the message using ProcessNaturalLanguage:

    • If the message is a Bible Reference (e.g., "John 3:16"), it retrieves the passage.
    • If the message contains Extracted References (e.g., "Explain John 3:16"), it treats it as a query (GetBibleAsk) and passes the references as context.
    • If the message is a Short Phrase (< 5 words, no '?'), it performs a Keyword Search (GetBibleSearch).
    • Otherwise, it treats it as a question (GetBibleAsk).
  2. New Command: Added /passage command to explicitly access the old default behavior (getting a passage).

  3. Refactoring:

    • pkg/app/bible_reference.go was refactored to support partial reference matching (ParseBibleReferenceFromStart) and extraction (ExtractBibleReferences).
    • pkg/app/ask.go was updated to allow passing contextVerses to the API.
  4. Testing:

    • Added TestExtractBibleReferences.
    • Added pkg/app/natural_language_test.go with 12+ test cases covering various routing scenarios including single chapter books, command-like phrases, and mixed inputs.

PR created automatically by Jules for task 4998359254942843604 started by @julwrites

- Introduce `CMD_PASSAGE` (/passage) for explicit passage retrieval.
- Implement `ProcessNaturalLanguage` router for messages without commands.
- Add `ExtractBibleReferences` in `pkg/app/bible_reference.go` to find multiple references in text.
- Refactor `GetBibleAsk` to accept context verses.
- Route short phrases to Search and longer prompts to Ask (with extracted references).
- Add comprehensive integration tests in `pkg/app/natural_language_test.go` covering Passage, Search, and Ask scenarios.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@julwrites julwrites marked this pull request as ready for review November 29, 2025 11:03
@julwrites julwrites merged commit f380909 into staging Nov 29, 2025
1 check passed
@julwrites julwrites deleted the enhance-default-behavior-chat-interface-tests branch November 29, 2025 11:04
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