Skip to content

dlgforge.tools

Public exports for external tool integrations.

SerperWebSearchClient(num_results=5, timeout=30, api_key=None)

Serper web search client.

Parameters:

Name Type Description Default
num_results int

int value used by this operation.

5
timeout int

int value used by this operation.

30
api_key str | None

str | None value used by this operation.

None

Raises:

Type Description
Exception

Construction may raise when required dependencies or inputs are invalid.

Side Effects / I/O: - May perform network, model, or distributed runtime operations.

Preconditions / Invariants: - Instantiate and use through documented public methods.

Examples:

>>> from dlgforge.tools.web_search import SerperWebSearchClient
>>> SerperWebSearchClient(...)

search(query)

Execute a web search query.

Parameters:

Name Type Description Default
query str

Input text.

required

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: Value produced by this API.

Raises:

Type Description
RuntimeError

Raised when validation or runtime requirements are not met.

Side Effects / I/O: - May perform network, model, or distributed runtime operations.

Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.

Examples:

>>> from dlgforge.tools.web_search import SerperWebSearchClient
>>> instance = SerperWebSearchClient(...)
>>> instance.search(...)

configure_retrieval(cfg, project_root)

Configure retrieval.

Parameters:

Name Type Description Default
cfg Dict[str, Any]

Configuration mapping that controls runtime behavior.

required
project_root Path

Resolved project directory context.

required

Returns:

Name Type Description
None None

No value is returned.

Raises:

Type Description
Exception

Propagates unexpected runtime errors from downstream calls.

Side Effects / I/O: - May read from or write to local filesystem artifacts.

Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.

Examples:

>>> from dlgforge.tools.retrieval import configure_retrieval
>>> configure_retrieval(...)

get_vector_store()

Get vector store.

Returns:

Name Type Description
KnowledgeVectorStore KnowledgeVectorStore

Value produced by this API.

Raises:

Type Description
RuntimeError

Raised when validation or runtime requirements are not met.

Side Effects / I/O: - May read from or write to local filesystem artifacts.

Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.

Examples:

>>> from dlgforge.tools.retrieval import get_vector_store
>>> get_vector_store(...)

Vector db search.

Parameters:

Name Type Description Default
query str

Input text.

required
k Optional[int]

Numeric control value for processing behavior.

None
use_reranker bool

bool value used by this operation.

False

Returns:

Type Description
Dict[str, Any]

Dict[str, Any]: Value produced by this API.

Raises:

Type Description
Exception

Propagates unexpected runtime errors from downstream calls.

Side Effects / I/O: - May read from or write to local filesystem artifacts.

Preconditions / Invariants: - Callers should provide arguments matching annotated types and expected data contracts.

Examples:

>>> from dlgforge.tools.retrieval import vector_db_search
>>> vector_db_search(...)