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 GitBook Plugin provider #1126

Merged
merged 24 commits into from
Dec 28, 2024

Conversation

azep-ninja
Copy link
Contributor

@azep-ninja azep-ninja commented Dec 16, 2024

Relates to:

N/A

Risks

Low: Adding new features

  • Adds GitBook documentation querying capability
  • No database changes
  • No security implications

Background

What does this PR do?

Adds a new GitBook documentation plugin that enables:

  • Dynamic documentation querying through GitBook API
  • Configurable keyword and trigger matching
  • Automatic response generation from documentation content

What kind of change is this?

Features:

  • Adds ability to query GitBook for internal docs
  • Adds new client configuration options for GitBook integration
  • Implements smart query validation to prevent API spam

Documentation changes needed?

Yes, my changes require updates to the project documentation:

  1. Add new GitBook configuration section to character.json:
{
    "clientConfig": {
        "gitbook": {
            "keywords": {
                "projectTerms": ["term1", "term2"],  // Project-specific terms
                "generalQueries": ["custom1", "custom2"]  // Additional query terms
            },
            "documentTriggers": ["help", "docs", "guide"]  // Documentation triggers
        }
    }
}

Testing

Where should a reviewer start?

Review the plugin implementation in:

plugin-gitbook/src/providers/gitbook.ts
plugin-gitbook/src/types.ts
plugin-gitbook/src/index.ts

Check the character configuration handling

Detailed testing steps

  1. Configure GitBook space ID:
    GITBOOK_SPACE_ID=your_space_id

  2. Test with different configurations:

  • Without any gitbook config (should use defaults)
  • With partial config (should merge with defaults)
  • With full config (should use provided settings)
  1. Test query validation:
  • General queries
  • Project-specific terms
  • Document triggers
  • Combinations of above
  1. Verify response handling:
  • Correct documentation retrieval
  • Proper response formatting
  • Error handling
  • Plugin is designed to be configurable but work with sensible defaults
  • Implementation focuses on preventing unnecessary API calls while maintaining functionality
  • No database changes required
  • No special deployment steps needed

@madjin
Copy link
Collaborator

madjin commented Dec 16, 2024

this sounds useful 👍

@odilitime odilitime added the Plugin_new Mark PRs that are a new plugin label Dec 17, 2024
@odilitime odilitime deleted the branch elizaOS:develop December 17, 2024 02:33
@odilitime odilitime closed this Dec 17, 2024
@odilitime odilitime reopened this Dec 17, 2024
@shakkernerd shakkernerd deleted the branch elizaOS:develop December 17, 2024 03:45
@odilitime odilitime reopened this Dec 17, 2024
@shakkernerd shakkernerd deleted the branch elizaOS:develop December 22, 2024 07:01
@odilitime odilitime reopened this Dec 22, 2024
@azep-ninja
Copy link
Contributor Author

Updated all files to elizaos. Ready to merge @odilitime

@samarth30
Copy link
Member

your branch seems out of date. can you pull / rebase your branch @azep-ninja

@azep-ninja
Copy link
Contributor Author

@samarth30 branch has been updated.

Copy link
Member

@shakkernerd shakkernerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@shakkernerd shakkernerd merged commit dcc357b into elizaOS:develop Dec 28, 2024
3 checks passed
@azep-ninja azep-ninja deleted the feature/add-gitbook-provider branch December 28, 2024 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Plugin_new Mark PRs that are a new plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants