Spaces:
Sleeping
Sleeping
| import os | |
| import openai | |
| from prompt import system_instruction, user_prompt | |
| client = openai.OpenAI( | |
| base_url="https://api.cerebras.ai/v1", | |
| api_key=os.environ.get("CEREBRAS_API_KEY") | |
| ) | |
| def run(input_text): | |
| completion = client.chat.completions.create( | |
| model="llama-3.3-70b", | |
| temperature=0.0, | |
| seed=42, | |
| messages=[ | |
| { | |
| "role": "system", | |
| "content": system_instruction | |
| }, | |
| { | |
| "role": "user", | |
| "content": user_prompt | |
| }, | |
| { | |
| "role": "user", | |
| "content": f"Time Entry Input: `{input_text}`" | |
| } | |
| ] | |
| ) | |
| print(completion) | |
| return completion.choices[0].message.content |