You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18Lines changed: 18 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,24 @@ response = llm.chat(f"Based on this, what is the latest: {website_text}")
84
84
print(response)
85
85
```
86
86
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 importLLM
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
+
87
105
# Key features
88
106
Monitor usage and manage spend via the model dashboard on [Lightning AI](https://lightning.ai/).
0 commit comments