This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from .aigenerator import * | |
def getDescription(businessName, businessDo, length): | |
description = returnSection1Description(businessName, businessDo) | |
if len(description) < length: | |
return description | |
else: | |
desc_list = description.split('.') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.shortcuts import render, redirect | |
from .models import * | |
from .aigenerator import * | |
from .functions import * | |
from django.contrib import messages | |
from django.conf import settings | |
import time | |
def home(request): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import openai | |
from django.conf import settings | |
openai.api_key = settings.OPENAI_API_KEY | |
def returnSection1Title(businessDo): | |
response = openai.Completion.create( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.template.defaultfilters import slugify | |
from django.contrib.auth.models import User | |
from django.utils import timezone | |
from uuid import uuid4 | |
class Profile(models.Model): | |
user = models.OneToOneField(User, on_delete=models.CASCADE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from flask import Flask, render_template, request | |
app = Flask(__name__) | |
# Get the news stories | |
api_key = None | |
base_url = None | |
def configure_request(app): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import openai | |
import config | |
openai.api_key = config.OPENAI_API_KEY | |
def runSomeCode(): | |
response = openai.Completion.create( | |
engine="code-davinci-001", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template, request | |
import config | |
import aicontent | |
def page_not_found(e): | |
return render_template('404.html'), 404 | |
app = Flask(__name__) | |
app.config.from_object(config.config['development']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openai | |
import config | |
openai.api_key = config.OPENAI_API_KEY | |
def openAIQuery(query): | |
response = openai.Completion.create( | |
engine="davinci-instruct-beta-v3", | |
prompt=query, | |
temperature=0.8, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content="Skolo Online Learning"> | |
<title>Skolo</title> | |
<link rel="shortcut icon" type="image/x-icon" href="{{ url_for('static', filename='images/favicon.png') }}"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/classify', methods=["GET", "POST"]) | |
def classify(): | |
query = 'Polokwane lang:en -is:retweet' | |
if request.method == 'POST': | |
query = '{} lang:en -is:retweet'.format(request.form['query']) | |
max_results = 20 |