Skip to content

Commit cedc3b8

Browse files
authored
Clear our non log & detect (#96)
* Clear our non log & detect * Remove imports * Fix readme
1 parent 6526cd1 commit cedc3b8

29 files changed

+12
-5046
lines changed

README.md

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
## Overview
55

6-
`quotientai` is an SDK and CLI built to manage artifacts (prompts, datasets), and run evaluations on [Quotient](https://quotientai.co).
6+
`quotientai` is an SDK and CLI for logging data to [Quotient](https://quotientai.co), and running hallucination and document attribution detections for retrieval and search-augmented AI systems.
77

88
## Installation
99

@@ -17,41 +17,6 @@ Create an API key on Quotient and set it as an environment variable called `QUOT
1717

1818
### Examples
1919

20-
**Create a prompt:**
21-
22-
```python
23-
from quotientai import QuotientAI
24-
25-
quotient = QuotientAI()
26-
27-
new_prompt = quotient.prompts.create(
28-
name="customer-support-inquiry",
29-
system_prompt="You are a helpful assistant.",
30-
user_prompt="How can I assist you today?"
31-
)
32-
33-
print(new_prompt)
34-
```
35-
36-
**Create a dataset:**
37-
38-
```python
39-
from quotientai import QuotientAI
40-
41-
quotient = QuotientAI()
42-
43-
new_dataset = quotient.datasets.create(
44-
name="my-sample-dataset"
45-
description="My first dataset",
46-
rows=[
47-
{"input": "Sample input", "expected": "Sample output"},
48-
{"input": "Another input", "expected": "Another output"}
49-
]
50-
)
51-
52-
print(new_dataset)
53-
```
54-
5520
**Create a log with hallucination detection:**
5621
Log an event with hallucination detection. This will create a log event in Quotient and perform hallucination detection on the model output, input, and documents. This is a fire and forget operation, so it will not block the execution of your code.
5722

@@ -74,7 +39,7 @@ quotient_logger = quotient.logger.init(
7439
# Mock retrieved documents
7540
retrieved_documents = [{"page_content": "Sample document"}]
7641

77-
response = quotient_logger.log(
42+
log_id = quotient_logger.log(
7843
user_query="Sample input",
7944
model_output="Sample output",
8045
# Page content from Documents from your retriever used to generate the model output
@@ -94,7 +59,7 @@ response = quotient_logger.log(
9459
tags={"model": "gpt-4o-mini", "feature": "customer-support"},
9560
)
9661

97-
print(response)
62+
print(log_id)
9863
```
9964

10065
You can also use the async client if you need to create logs asynchronously.
@@ -120,7 +85,7 @@ async def main():
12085
# Mock retrieved documents
12186
retrieved_documents = [{"page_content": "Sample document"}]
12287

123-
response = await quotient_logger.log(
88+
log_id = await quotient_logger.log(
12489
user_query="Sample input",
12590
model_output="Sample output",
12691
# Page content from Documents from your retriever used to generate the model output
@@ -140,7 +105,7 @@ async def main():
140105
tags={"model": "gpt-4o-mini", "feature": "customer-support"},
141106
)
142107

143-
print(response)
108+
print(log_id)
144109

145110

146111
# Run the async function

examples/async_simple_evaluate.py

Lines changed: 0 additions & 76 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

examples/simple_evaluate.py

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

0 commit comments

Comments
 (0)