Planner-X

Planner X

Advanced collaborative planner for the most demanding teams.

Prima luce, cum quibus mons aliud consensu ab eo.

Quae vero auctorem tractata ab fiducia dicuntur. Fabio vel iudice vincam, sunt in culpa qui officia. Quisque ut dolor gravida, placerat libero vel, euismod. Excepteur sint obcaecat cupiditat non proident culpa. Quam diu etiam furor iste tuus nos eludet? Cum sociis natoque penatibus et magnis dis parturient. Curabitur est gravida et libero vitae dictum.

python
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
33
34
import openai

# Set your OpenAI API key
openai.api_key = 'YOUR_API_KEY'

def generate_text_with_prompt(prompt, engine="text-davinci-003", max_tokens=150, n=1):
    """
    Generate text using OpenAI API based on the given prompt.

    Args:
        prompt (str): The prompt to generate text from.
        engine (str): The engine to use (default: "text-davinci-003").
        max_tokens (int): Maximum number of tokens in the generated text (default: 150).
        n (int): Number of completions to generate (default: 1).

    Returns:
        str: Generated text.
    """
    try:
        response = openai.Completion.create(
            engine=engine,
            prompt=prompt,
            max_tokens=max_tokens,
            n=n,
        )
        generated_text = response.choices[0].text.strip()
        return generated_text
    except Exception as e:
        return f"Error: {e}"

# Example usage
prompt = "Once upon a time, in a land far, far away, there was a dragon."
generated_text = generate_text_with_prompt(prompt)
print(generated_text)

Fake function - for example purposes

Inmensae subtilitatis, obscuris et malesuada fames. Me non paenitet nullum festiviorem excogitasse ad hoc. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Morbi fringilla convallis sapien, id pulvinar odio volutpat.