bridge.services.protocols package#
Public Interface#
This section documents user-facing interface of the bridge.services.protocols package (as defined in its __init__.py file).
Classes#
|
Protocol for classes that fetch raw metadata from an external source. |
|
Protocol for repository operations. |
|
Generic metadata for a forked repository. |
|
Protocol for LLM providers that generate chat-based responses. |
|
A message in a chat conversation. |
Protocols and base classes for services.
- class bridge.services.protocols.ChatMessage(**data)[source]#
Bases:
BaseModelA message in a chat conversation.
- Parameters:
role (Literal['system', 'user', 'assistant'])
content (str)
- role#
The role of the message sender. One of: - “system”: Instructions or global context for the LLM assistant. - “user”: A message from the user. - “assistant”: A message from the LLM assistant.
- Type:
Literal[“system”, “user”, “assistant”]
- content#
The content of the message.
- Type:
str
-
content:
str#
-
role:
Literal['system','user','assistant']#
- class bridge.services.protocols.ForkInfo(full_name, owner, repo)[source]#
Bases:
objectGeneric metadata for a forked repository.
- Parameters:
full_name (str)
owner (str)
repo (str)
-
full_name:
str= <dataclasses._MISSING_TYPE object>#
-
owner:
str= <dataclasses._MISSING_TYPE object>#
-
repo:
str= <dataclasses._MISSING_TYPE object>#
- class bridge.services.protocols.Ingestor(*args, **kwargs)[source]#
Bases:
ProtocolProtocol for classes that fetch raw metadata from an external source.
- class bridge.services.protocols.LLMProvider(*args, **kwargs)[source]#
Bases:
ProtocolProtocol for LLM providers that generate chat-based responses.
- async generate(messages)[source]#
Generate a chat-based response from the model.
- Return type:
- Parameters:
messages (list[ChatMessage])
- class bridge.services.protocols.RepoProvider(*args, **kwargs)[source]#
Bases:
ProtocolProtocol for repository operations.
- apply_changes_and_push(repo_path, branch_name, file_changes)[source]#
Apply file changes and push to a branch.
- Parameters:
repo_path (str)
branch_name (str)
file_changes (dict)
- clone_context(repo_full_name)[source]#
Use context manager to clone a repository.
- Return type:
AbstractContextManager[str]- Parameters:
repo_full_name (str)
- async create_issue(owner, repo, title, body='', labels=None, assignees=None)[source]#
Create a new issue on a repository.
- Return type:
dict- Parameters:
owner (str)
repo (str)
title (str)
body (str)
labels (list[str] | None)
assignees (list[str] | None)
Submodules#
Service protocol for fetching raw external data. |
|
Typed chat message model and an LLMProvider protocol. |
|
Protocol for repository operations and a minimal ForkInfo dataclass. |
Dependencies diagram#
Each architecture diagram below visualizes the internal dependency structure of the bridge.services.protocols package.
It shows how modules and subpackages within the package depend on each other, based on direct Python imports.
Packages are shown as purple rectangles
Modules are shown as pink rectangles
Arrows (A → B) indicate that A directly imports B
Each subpackage’s diagram focuses only on its own internal structure, it does not include imports to or from higher-level packages (those appear in the parent package’s diagram).