>>109192337
Its API endpoint is dead simple and has no authentication whatsoever.
# /// script
# requires-python = ">=3.14"
# dependencies = [
# "httpx2>=2.5.0",
# ]
# ///
import httpx2
import sys
with httpx2.Client() as client:
with client.sse(
"https://api.talkie-lm.com/api/chat/stream",
method="POST",
json={
"messages": [
{
"role": "user",
"content": " ".join(sys.argv[1:]),
},
],
"temperature": 0.7,
"max_tokens": 4096,
},
) as source:
previous_event = "token"
for event in source:
data = event.json()
if previous_event != event.event:
print("\n" if previous_event == "token" else "")
previous_event = event.event
if event.event == "token":
print(end=data)
else:
print(f"{event.event}:", " ".join(f"{k}={v}" for k, v in data.items()))
$ uv run talkie.py "What is the meaning of Leviticus 18:22?"
In Leviticus 18:22, it is enacted that thou shalt not lie with mankind, as well as with woman-kind; the reason of which prohibition is, because both sorts of uncleanness are equally abominable to the Lord.
moderation: is_unsafe=False
done: finish_reason=stop is_unsafe=False