repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | from typing import Optional |
| #2 | from pydantic import Field |
| #3 | |
| #4 | from mem0.configs.rerankers.base import BaseRerankerConfig |
| #5 | |
| #6 | |
| #7 | class LLMRerankerConfig(BaseRerankerConfig): |
| #8 | """ |
| #9 | Configuration for LLM-based reranker. |
| #10 | |
| #11 | Attributes: |
| #12 | model (str): LLM model to use for reranking. Defaults to "gpt-4o-mini". |
| #13 | api_key (str): API key for the LLM provider. |
| #14 | provider (str): LLM provider. Defaults to "openai". |
| #15 | top_k (int): Number of top documents to return after reranking. |
| #16 | temperature (float): Temperature for LLM generation. Defaults to 0.0 for deterministic scoring. |
| #17 | max_tokens (int): Maximum tokens for LLM response. Defaults to 100. |
| #18 | scoring_prompt (str): Custom prompt template for scoring documents. |
| #19 | """ |
| #20 | |
| #21 | model: str = Field( |
| #22 | default="gpt-4o-mini", |
| #23 | description="LLM model to use for reranking" |
| #24 | ) |
| #25 | api_key: Optional[str] = Field( |
| #26 | default=None, |
| #27 | description="API key for the LLM provider" |
| #28 | ) |
| #29 | provider: str = Field( |
| #30 | default="openai", |
| #31 | description="LLM provider (openai, anthropic, etc.)" |
| #32 | ) |
| #33 | top_k: Optional[int] = Field( |
| #34 | default=None, |
| #35 | description="Number of top documents to return after reranking" |
| #36 | ) |
| #37 | temperature: float = Field( |
| #38 | default=0.0, |
| #39 | description="Temperature for LLM generation" |
| #40 | ) |
| #41 | max_tokens: int = Field( |
| #42 | default=100, |
| #43 | description="Maximum tokens for LLM response" |
| #44 | ) |
| #45 | scoring_prompt: Optional[str] = Field( |
| #46 | default=None, |
| #47 | description="Custom prompt template for scoring documents" |
| #48 | ) |
| #49 |