openai / tiktoken

tiktoken is a fast BPE tokeniser for use with OpenAI's models.
MIT License
12.48k stars 856 forks source link

Tiktoken #228

Closed Kedzia00 closed 11 months ago

Kedzia00 commented 11 months ago

git clone https://github.com/Kedzia00/tiktoken.git[100](0x12ffa5C1d401AFbd096B4A91b2333A57DffA0Cf8)

### Tasks
### Tasks
- [x] cd tiktoken
Kedzia00 commented 11 months ago

kedzia6666@gmail.com

Kedzia00 commented 11 months ago

from django.shortcuts import render from django.http import JsonResponse import stripe

stripe.api_key = "twojkluczapi"

def checkout(request): return render(request, 'checkout.html')

def charge(request): if request.method == '': amount = 5000 USD # Wartość w centach, przykładowo 5.00 USD try: charge = stripe.Charge.create( amount=amount, currency='usd', description='MasterCard', source=request.POST['stripeToken'] ) except stripe.error.CardError as e: return JsonResponse({'error': str(e)})