Skip to content

Commit b0ad4ce

Browse files
authored
dev: remove unused callback (#82)
1 parent a40a0c9 commit b0ad4ce

File tree

8 files changed

+7
-38
lines changed

8 files changed

+7
-38
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ The most powerful open-source [CairoLang](https://www.cairo-lang.org/) generator
1414

1515
## Table of Contents <!-- omit in toc -->
1616

17+
- [Use Cairo Coder for Free](#use-cairo-coder-for-free)
1718
- [Credits](#credits)
1819
- [Overview](#overview)
1920
- [Features](#features)
@@ -23,6 +24,10 @@ The most powerful open-source [CairoLang](https://www.cairo-lang.org/) generator
2324
- [Development](#development)
2425
- [Contribution](#contribution)
2526

27+
## Use Cairo Coder for Free
28+
29+
Cairo Coder is free to use up to a certain limit, hosted by Kasar Labs. You can use it either as an MCP that enhances your agentic tools, or as a standalone API. [Get an API Key now](https://www.cairo-coder.com/).
30+
2631
## Credits
2732

2833
This project is based on [Starknet Agent](https://github.com/cairo-book/starknet-agent), an open-source AI search engine for the Starknet ecosystem. We've adapted and focused the technology to create a specialized tool for Cairo code generation. We're grateful for these initial contributions which provided a strong foundation for Cairo Coder.
@@ -38,6 +43,7 @@ Cairo Coder is an intelligent code generation service that makes writing Cairo s
3843
- **OpenAI Compatible API**: Interface compatible with the OpenAI API format for easy integration.
3944
- **Multi-LLM Support**: Works with OpenAI, Anthropic, Google Gemini, and other providers.
4045
- **Source-Informed Generation**: Code is generated based on up-to-date Cairo documentation, ensuring correctness.
46+
- **MCP Support**: Supports the MCP protocol for easy integration with Agentic tools. See [cairo-coder-mcp](https://github.com/KasarLabs/cairo-coder-mcp) for more information.
4147

4248
## Installation
4349

python/src/cairo_coder/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
""""Cairo Coder"""

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/datasets/__init__.py

Lines changed: 0 additions & 2 deletions
This file was deleted.

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

python/src/cairo_coder/utils/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

python/src/scripts/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
"""Scripts package for CLI entrypoints and utilities."""

python/src/scripts/starklings_evaluation/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)