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
4 changes: 4 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ jobs:

- name: Typecheck
run: pnpm typecheck

# The runner image has ShellCheck.
- name: Check the installer
run: shellcheck public/install
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ uv add --editable path/to/eac/sdks/python # the SDK, in your project
Install the CLI and the SDK from a GitHub release, here `0.0.1`:

```sh
gh release download 0.0.1 -R getsentry/eac -p eac-Darwin-universal -O ~/.local/bin/eac
chmod +x ~/.local/bin/eac
EAC_VERSION=0.0.1 bash docs/public/install # the installer at eac.sentry.dev/install
gh release download 0.0.1 -R getsentry/eac -p 'eac_sdk-*.whl' -D /tmp/eac
uv pip install /tmp/eac/eac_sdk-0.0.1-py3-none-any.whl # in your project
```
Expand Down
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ EAC is a command line tool & SDKs to write evals for AI systems. It handles fixt
### 1. Install

```sh
git clone https://github.com/getsentry/eac.git && cd eac
make install # needs Rust 1.87+
pip install -e sdks/python # needs Python 3.11+
curl -fsSL https://eac.sentry.dev/install | bash # the CLI, on macOS or Linux

git clone https://github.com/getsentry/eac.git
pip install -e eac/sdks/python # the SDK, needs Python 3.11+
```

To build the CLI from source instead, run `make install` in the repo (needs Rust 1.87+).

### 2. Write an eval

Add a `dataset.yml` and the code it points to, anywhere in your repo.
Expand All @@ -37,14 +40,27 @@ def reply(query: str) -> str:


class ChatRunner(OfflineRunner):
def run_case(self, case: Case, *, seed_results: dict[str, dict[str, Any]], conversation_id: str) -> dict[str, Any]:

def run_case(
self,
case: Case,
*,
seed_results: dict[str, dict[str, Any]],
conversation_id: str,
) -> dict[str, Any]:
return {"response": reply(case.input["query"])}


class Greets(Judge):
name = "greets_judge"

def judge(self, case: Case, *, seed_results: dict[str, dict[str, Any]], agent_trace: Any = None) -> Score | None:
def judge(
self,
case: Case,
*,
seed_results: dict[str, dict[str, Any]],
agent_trace: Any = None,
) -> Score | None:
response = case.run_results.get("response", "")
if "hello" in response:
return Score(name=self.name, score=1.0)
Expand Down
10 changes: 10 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ example, steps and terminal (`components/terminal.tsx`). The terminal plays
what the example prints, ANSI colors included. When the CLI's output changes,
run each example and update its `output` in `EXAMPLES` to match.

A language dropdown, the same setting as the sidebar's, picks the SDK whose
install command and eval code the steps show, from `SDKS`. When you add a
language, give it an entry there.

## Installer

`public/install` is the CLI's install script, served at `/install` for
`curl -fsSL https://eac.sentry.dev/install | bash`. It downloads the binaries
`.craft.yml` attaches to each GitHub release, by name. CI runs ShellCheck on it.

## Adding a page

1. Create `app/<slug>/page.mdx`, starting with `export const metadata = {title: '...'}`.
Expand Down
8 changes: 7 additions & 1 deletion docs/app/cases-and-runners/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ from eac import Case, OfflineRunner
class OfflineTriageRunner(OfflineRunner):
credentials = [OpenRouterKey(), SentryLogin()]

def run_case(self, case: Case, *, seed_results: dict[str, dict[str, Any]], conversation_id: str) -> dict[str, Any]:
def run_case(
self,
case: Case,
*,
seed_results: dict[str, dict[str, Any]],
conversation_id: str,
) -> dict[str, Any]:
alert = case.input["alert"].format(release=seed_results["incident"]["release"])
model = self.args.get("model", DEFAULT_MODEL)
return triage(alert, conversation_id=conversation_id, model=model)
Expand Down
29 changes: 25 additions & 4 deletions docs/app/introduction/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,20 @@ Set up a project and run a first eval. It takes about five minutes.

### Install

eac doesn't have packaged releases yet, so build the CLI from the repo. You'll need Rust 1.87+.
Install the CLI on macOS or Linux:

```sh
make install # puts eac on your PATH
curl -fsSL https://eac.sentry.dev/install | bash
```

It puts `eac` in `~/.local/bin`. To pick another directory or a specific release:

```sh
curl -fsSL https://eac.sentry.dev/install | EAC_INSTALL_DIR=/usr/local/bin EAC_VERSION=0.1.0 bash
```

To build from source instead, run `make install` in the repo (needs Rust 1.87+).

Then install the SDK into the environment your evals run in:

<LanguageCode>
Expand Down Expand Up @@ -106,14 +114,27 @@ def reply(query: str) -> str:


class ChatRunner(OfflineRunner):
def run_case(self, case: Case, *, seed_results: dict[str, dict[str, Any]], conversation_id: str) -> dict[str, Any]:

def run_case(
self,
case: Case,
*,
seed_results: dict[str, dict[str, Any]],
conversation_id: str,
) -> dict[str, Any]:
return {"response": reply(case.input["query"])}


class Greets(Judge):
name = "greets"

def judge(self, case: Case, *, seed_results: dict[str, dict[str, Any]], agent_trace: Any = None) -> Score | None:
def judge(
self,
case: Case,
*,
seed_results: dict[str, dict[str, Any]],
agent_trace: Any = None,
) -> Score | None:
ok = "hello" in case.run_results.get("response", "")
return Score(name=self.name, score=1.0 if ok else 0.0)

Expand Down
21 changes: 18 additions & 3 deletions docs/app/judges/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ class FoundIssueJudge(Judge):

name = "found_issue"

def judge(self, case: Case, *, seed_results: dict[str, dict[str, Any]], agent_trace: Any = None) -> Score | None:
def judge(
self,
case: Case,
*,
seed_results: dict[str, dict[str, Any]],
agent_trace: Any = None,
) -> Score | None:
error = case.expected_output["error"]
expected = seed_results["incident"]["issues"][error] if error else None
actual = case.run_results.get("issue")
Expand Down Expand Up @@ -55,7 +61,10 @@ class TriageLLMJudge(Judge):
conversation = load_conversation(run.conversation_id)
if conversation is None:
return None
return AgentTrace(trace=conversation["messages"], metrics=LLMMetrics(**conversation["usage"]))
return AgentTrace(
trace=conversation["messages"],
metrics=LLMMetrics(**conversation["usage"]),
)
```

</CodeFile>
Expand All @@ -73,7 +82,13 @@ An LLM judge asks a model to grade the trace. This one asks two true-or-false qu
<CodeFile filename="evals/triage/judges/triage_llm_judge.py" source="examples/sentry-assistant-python/evals/triage/judges/triage_llm_judge.py">

```python
def judge(self, case: Case, *, seed_results: dict[str, dict[str, Any]], agent_trace: Any = None) -> Score | None:
def judge(
self,
case: Case,
*,
seed_results: dict[str, dict[str, Any]],
agent_trace: Any = None,
) -> Score | None:
if agent_trace is None:
return None
with client() as openrouter:
Expand Down
1 change: 1 addition & 0 deletions docs/app/online-evals/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ from eac import Case, OnlineRunner, Window


class OnlineTriageRunner(OnlineRunner):

def collect_cases(self, window: Window) -> list[Case]:
conversations = recent_conversations(window.since, window.until)
sampled = [c for c in conversations if window.samples(c["conversation_id"])]
Expand Down
1 change: 1 addition & 0 deletions docs/app/seeds/page.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ The cache lives on your machine by default. To share fixtures across CI jobs, st

```python
class SharedSeed(Seed):

def load_cached(self, key: str) -> dict[str, Any] | None:
return bucket.get(f"seeds/{self.name}/{key}")

Expand Down
2 changes: 1 addition & 1 deletion docs/components/docsShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function DocsShell({children}: {children: React.ReactNode}) {
<Text size="xs" variant="muted" uppercase bold>
Language
</Text>
<LanguageSelect />
<LanguageSelect fullWidth />
</Stack>
{NAV.map(section => (
<Stack key={section.title} gap="sm">
Expand Down
Loading
Loading