import openaiclient = openai.OpenAI( base_url="https://api.llm7.io/v1", api_key="unused", # replace if you have a token)resp = client.chat.completions.create( model="default", messages=[ {"role": "user", "content": "Tell me a short story about a brave squirrel."} ],)print(resp.choices[0].message.content)
The output will be a short story generated by the model, for example:
Copy
Once upon a time, in a lush green forest, there lived a brave squirrel named Sammy. Sammy was known for his adventurous spirit and his willingness to help others. One day, a fierce storm hit the forest, causing a massive tree to fall and block the entrance to the squirrel village. Without hesitation, Sammy gathered his friends and devised a plan to clear the path. With teamwork and determination, they managed to move the fallen tree and restore access to their home. The villagers celebrated Sammy's bravery, and he became a legend in the forest for his courageous act.