conceptofmind / toolformer

MIT License
338 stars 38 forks source link

Goose AI #12

Open conceptofmind opened 1 year ago

conceptofmind commented 1 year ago
'''
Goose AI

pip install openai

Uses GPT-NeoX 20B to generate text.

input_query - A string, the input query (e.g. "what is a dog?")

output - A string, the generated text

openai.api_key - your GooseAI API key
'''
def GooseAI(input_query: str):
    openai.api_key = "YOUR_API_KEY"
    openai.api_base = "https://api.goose.ai/v1"
    # Create a completion, return results streaming as they are generated. 
    # Run with `python3 -u` to ensure unbuffered output.
    completion = openai.Completion.create(
        engine="gpt-neo-20b",
        prompt=input_query,
        max_tokens=160
        )
    return completion.choices[0].text
conceptofmind commented 1 year ago

No strong opinion. Huggingface API tool overlaps with this one.