from mira_network import MiraClientasync def generate_text(): async with MiraClient(api_key="your-api-key") as client: response = await client.chat_completions_create( model="your-chosen-model", messages=[ {"role": "user", "content": "What is the capital of France?"} ] ) print(response["choices"][0]["message"]["content"])
messages = [ {"role": "system", "content": "You are a helpful assistant"}, {"role": "user", "content": "Hi! Can you help me?"}, {"role": "assistant", "content": "Of course! What can I help you with?"}, {"role": "user", "content": "Tell me about Paris"}]async with MiraClient(api_key="your-api-key") as client: response = await client.chat_completions_create( model="your-chosen-model", messages=messages )