Method
completion
(self, prompt: str, openai_client)
Source from the content-addressed store, hash-verified
| 31 | @track_agent(name="engineer") |
| 32 | class EngineerAgent: |
| 33 | async def completion(self, prompt: str, openai_client): |
| 34 | res = await openai_client.chat.completions.create( |
| 35 | model="gpt-3.5-turbo", |
| 36 | messages=[ |
| 37 | { |
| 38 | "role": "system", |
| 39 | "content": "You are a " |
| 40 | "software " |
| 41 | "engineer and " |
| 42 | "only output " |
| 43 | "python code, " |
| 44 | "no markdown " |
| 45 | "tags.", |
| 46 | }, |
| 47 | {"role": "user", "content": prompt}, |
| 48 | ], |
| 49 | temperature=0.5, |
| 50 | ) |
| 51 | return res.choices[0].message.content |
Callers
nothing calls this directly
Tested by
no test coverage detected