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

Add Support for Knowledge Base Retrieval Params & Preprocessing #61

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

tmichaeldb
Copy link
Contributor

This PR adds support for preprocessing knowledge base documents two ways:

  1. TextChunkingConfig to split loaded documents into chunks before embedding
  2. ContextualConfig to support Contextual Retrieval (ref)

It also supports passing in parameters to Knowledge Base creation to configure retrieval. Example:

params = {
    'search_kwargs': {
        'k': 10
    }
}

Comment on lines +28 to +31
class LLMConfig(BaseModel):
model_name: str = Field(default=DEFAULT_LLM_MODEL, description='LLM model to use for context generation')
provider: str = Field(default=DEFAULT_LLM_MODEL_PROVIDER, description='LLM model provider to use for context generation')
params: Dict[str, Any] = Field(default={}, description='Additional parameters to pass in when initializing the LLM')

Choose a reason for hiding this comment

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

🙏 Nice

@tmichaeldb tmichaeldb merged commit 5c6ddfb into main Nov 22, 2024
5 checks passed
@mindsdb mindsdb locked and limited conversation to collaborators Nov 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants