mirror of
https://github.com/kennethreitz/simplemind.git
synced 2026-06-05 06:46:18 +00:00
Add streaming support to XAI provider and update example usage
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
from _context import sm
|
||||
|
||||
# Defaults to the default provider (openai)
|
||||
r = sm.generate_text(
|
||||
"Write a poem about the moon", llm_model="gpt-4o-mini", stream=True
|
||||
)
|
||||
r = sm.generate_text("Write a poem about the moon", llm_provider="xai", stream=True)
|
||||
|
||||
for chunk in r:
|
||||
print(chunk, end="", flush=True)
|
||||
|
||||
Reference in New Issue
Block a user