Skip to content

Commit b9272dd

Browse files
committed
dev: remove unused callback
1 parent a40a0c9 commit b9272dd

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

python/src/cairo_coder/core/rag_pipeline.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import langsmith as ls
1414
import structlog
1515
from dspy.adapters import XMLAdapter
16-
from dspy.utils.callback import BaseCallback
1716
from langsmith import traceable
1817

1918
from cairo_coder.core.config import VectorStoreConfig
@@ -35,30 +34,6 @@
3534
SOURCE_PREVIEW_MAX_LEN = 200
3635

3736

38-
# 1. Define a custom callback class that extends BaseCallback class
39-
class AgentLoggingCallback(BaseCallback):
40-
def on_module_start(
41-
self,
42-
call_id: str,
43-
instance: Any,
44-
inputs: dict[str, Any],
45-
) -> None:
46-
logger.debug("Starting module", call_id=call_id, inputs=inputs)
47-
48-
# 2. Implement on_module_end handler to run a custom logging code.
49-
def on_module_end(
50-
self, call_id: str, outputs: dict[str, Any], exception: Exception | None
51-
) -> None:
52-
step = "Reasoning" if self._is_reasoning_output(outputs) else "Acting"
53-
logger.debug(f"== {step} Step ===")
54-
for k, v in outputs.items():
55-
logger.debug(f" {k}: {v}")
56-
logger.debug("\n")
57-
58-
def _is_reasoning_output(self, outputs: dict[str, Any]) -> bool:
59-
return any(k.startswith("Thought") for k in outputs if isinstance(k, str))
60-
61-
6237
@dataclass
6338
class RagPipelineConfig:
6439
"""Configuration for RAG Pipeline."""

python/src/cairo_coder/server/app.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@
2626
from cairo_coder.config.manager import ConfigManager
2727
from cairo_coder.core.agent_factory import AgentFactory, create_agent_factory
2828
from cairo_coder.core.config import VectorStoreConfig
29-
from cairo_coder.core.rag_pipeline import (
30-
AgentLoggingCallback,
31-
RagPipeline,
32-
)
29+
from cairo_coder.core.rag_pipeline import RagPipeline
3330
from cairo_coder.core.types import Message, Role, StreamEventType
3431
from cairo_coder.dspy.document_retriever import SourceFilteredPgVectorRM
3532
from cairo_coder.dspy.suggestion_program import SuggestionGeneration
@@ -188,7 +185,6 @@ def __init__(
188185
lm=dspy.LM("gemini/gemini-flash-latest", max_tokens=30000, cache=False),
189186
adapter=ChatAdapter(),
190187
embedder=embedder,
191-
callbacks=[AgentLoggingCallback()],
192188
track_usage=True,
193189
)
194190

0 commit comments

Comments
 (0)