Skip to content

Commit 2f63a7a

Browse files
Update README.md
1 parent a2be93c commit 2f63a7a

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,24 @@ response = llm.chat(f"Based on this, what is the latest: {website_text}")
8484
print(response)
8585
```
8686

87+
### Agentic if statement
88+
We believe the best way to build agents is to use normal Python programs with "agentic IF statements". This way, 90% of the flow is still deterministic
89+
with a few decisions made by a model. This avoids complex abstractions that agentic frameworks introduce with make agents unreliable and hard to debug.
90+
91+
```python
92+
from litai import LLM
93+
94+
llm = LLM(model="openai/gpt-4o")
95+
96+
product_review = "give me a short, bad product review about a tv"
97+
response = llm.chat(f"Is this review good or bad? Reply only with 'good' or 'bad': {product_review}").strip().lower()
98+
99+
if response == "good":
100+
print("✅ good review")
101+
else:
102+
print("❌ bad review")
103+
```
104+
87105
# Key features
88106
Monitor usage and manage spend via the model dashboard on [Lightning AI](https://lightning.ai/).
89107

0 commit comments

Comments
 (0)