-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproviders.py
More file actions
32 lines (25 loc) · 863 Bytes
/
providers.py
File metadata and controls
32 lines (25 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"""
Cost Katana Python SDK: Multi-Provider Examples
Demonstrates usage across different AI providers.
"""
import cost_katana as ck
def main():
print("\n🥷 Cost Katana Python SDK - Multi-Provider\n")
prompt = "What is Kubernetes?"
providers = [
('gpt-4', 'OpenAI'),
('claude-3-5-sonnet-20241022', 'Anthropic'),
('gemini-pro', 'Google'),
('nova-pro', 'AWS Bedrock'),
]
for model, provider_name in providers:
try:
print(f"\n{provider_name} ({model}):")
response = ck.ai(model, prompt)
print(f" Response: {response.text[:80]}...")
print(f" 💰 Cost: ${response.cost:.6f}")
except Exception as e:
print(f" ❌ Error: {str(e)}")
print("\n✅ One SDK, all providers!\n")
if __name__ == '__main__':
main()