Initial commit.

This commit is contained in:
2025-08-21 00:34:47 +02:00
commit d6b45d662d
40 changed files with 4396 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env python3
import asyncio
from pyr.core.config import PyrConfig
from pyr.core.app import create_app
async def basic_example():
config = PyrConfig(
provider="openai",
model="gpt-4o-mini",
verbose=True
)
async with create_app(config) as app:
response = await app.ai_client.chat("user", "Hello! Can you help me with Python?")
print("AI Response:", response)
async def tool_example():
config = PyrConfig(use_tools=True)
async with create_app(config) as app:
response = await app.chat_with_tools(
"user",
"Create a Python file called hello.py with a simple greeting function"
)
print("Tool-enhanced response:", response)
if __name__ == "__main__":
print("PYR Basic Usage Examples")
print("=" * 30)
print("\n1. Basic chat example:")
asyncio.run(basic_example())
print("\n2. Tool usage example:")
asyncio.run(tool_example())