Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The most powerful open-source [CairoLang](https://www.cairo-lang.org/) generator

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

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

## Use Cairo Coder for Free

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/).

## Credits

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.
Expand All @@ -38,6 +43,7 @@ Cairo Coder is an intelligent code generation service that makes writing Cairo s
- **OpenAI Compatible API**: Interface compatible with the OpenAI API format for easy integration.
- **Multi-LLM Support**: Works with OpenAI, Anthropic, Google Gemini, and other providers.
- **Source-Informed Generation**: Code is generated based on up-to-date Cairo documentation, ensuring correctness.
- **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.

## Installation

Expand Down
1 change: 0 additions & 1 deletion python/src/cairo_coder/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
""""Cairo Coder"""
25 changes: 0 additions & 25 deletions python/src/cairo_coder/core/rag_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import langsmith as ls
import structlog
from dspy.adapters import XMLAdapter
from dspy.utils.callback import BaseCallback
from langsmith import traceable

from cairo_coder.core.config import VectorStoreConfig
Expand All @@ -35,30 +34,6 @@
SOURCE_PREVIEW_MAX_LEN = 200


# 1. Define a custom callback class that extends BaseCallback class
class AgentLoggingCallback(BaseCallback):
def on_module_start(
self,
call_id: str,
instance: Any,
inputs: dict[str, Any],
) -> None:
logger.debug("Starting module", call_id=call_id, inputs=inputs)

# 2. Implement on_module_end handler to run a custom logging code.
def on_module_end(
self, call_id: str, outputs: dict[str, Any], exception: Exception | None
) -> None:
step = "Reasoning" if self._is_reasoning_output(outputs) else "Acting"
logger.debug(f"== {step} Step ===")
for k, v in outputs.items():
logger.debug(f" {k}: {v}")
logger.debug("\n")

def _is_reasoning_output(self, outputs: dict[str, Any]) -> bool:
return any(k.startswith("Thought") for k in outputs if isinstance(k, str))


@dataclass
class RagPipelineConfig:
"""Configuration for RAG Pipeline."""
Expand Down
2 changes: 0 additions & 2 deletions python/src/cairo_coder/datasets/__init__.py

This file was deleted.

6 changes: 1 addition & 5 deletions python/src/cairo_coder/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@
from cairo_coder.config.manager import ConfigManager
from cairo_coder.core.agent_factory import AgentFactory, create_agent_factory
from cairo_coder.core.config import VectorStoreConfig
from cairo_coder.core.rag_pipeline import (
AgentLoggingCallback,
RagPipeline,
)
from cairo_coder.core.rag_pipeline import RagPipeline
from cairo_coder.core.types import Message, Role, StreamEventType
from cairo_coder.dspy.document_retriever import SourceFilteredPgVectorRM
from cairo_coder.dspy.suggestion_program import SuggestionGeneration
Expand Down Expand Up @@ -188,7 +185,6 @@ def __init__(
lm=dspy.LM("gemini/gemini-flash-latest", max_tokens=30000, cache=False),
adapter=ChatAdapter(),
embedder=embedder,
callbacks=[AgentLoggingCallback()],
track_usage=True,
)

Expand Down
1 change: 0 additions & 1 deletion python/src/cairo_coder/utils/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion python/src/scripts/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
"""Scripts package for CLI entrypoints and utilities."""
3 changes: 0 additions & 3 deletions python/src/scripts/starklings_evaluation/__init__.py

This file was deleted.