| 6 | |
| 7 | @track_agent(name="qa") |
| 8 | class QaAgent: |
| 9 | async def completion(self, prompt: str, openai_client): |
| 10 | res = await openai_client.chat.completions.create( |
| 11 | model="gpt-3.5-turbo", |
| 12 | messages=[ |
| 13 | { |
| 14 | "role": "system", |
| 15 | "content": "You are a qa engineer and only output python code, no markdown tags.", |
| 16 | }, |
| 17 | {"role": "user", "content": prompt}, |
| 18 | ], |
| 19 | temperature=0.5, |
| 20 | ) |
| 21 | return res.choices[0].message.content |
| 22 | |
| 23 | def record_error(self): |
| 24 | agentops.record(ErrorEvent(details="Test error")) |
| 25 | |
| 26 | @record_function(event_name="add_two_record_action") |
| 27 | def record_action(self, a: int, b: int): |
| 28 | return a + b |
| 29 | |
| 30 | |
| 31 | @track_agent(name="engineer") |