(self, goal: str, screen_context: str, action_history: List[Dict])
| 103 | self.model = Config.OPENAI_MODEL |
| 104 | |
| 105 | def get_decision(self, goal: str, screen_context: str, action_history: List[Dict]) -> Dict[str, Any]: |
| 106 | history_str = format_action_history(action_history) |
| 107 | user_content = f"GOAL: {goal}\n\nSCREEN_CONTEXT:\n{screen_context}{history_str}" |
| 108 | |
| 109 | response = self.client.chat.completions.create( |
| 110 | model=self.model, |
| 111 | response_format={"type": "json_object"}, |
| 112 | messages=[ |
| 113 | {"role": "system", "content": SYSTEM_PROMPT}, |
| 114 | {"role": "user", "content": user_content} |
| 115 | ] |
| 116 | ) |
| 117 | |
| 118 | return json.loads(response.choices[0].message.content) |
| 119 | |
| 120 | |
| 121 | class BedrockProvider(LLMProvider): |
nothing calls this directly
no test coverage detected