MCPcopy Create free account
hub / github.com/abi/screenshot-to-code / run

Method run

backend/agent/engine.py:254–271  ·  view source on GitHub ↗
(self, model: Llm, prompt_messages: List[ChatCompletionMessageParam])

Source from the content-addressed store, hash-verified

252 raise Exception("Agent exceeded max tool turns")
253
254 async def run(self, model: Llm, prompt_messages: List[ChatCompletionMessageParam]) -> str:
255 self.tool_runtime.input_images = self._extract_input_images(prompt_messages)
256 seed_file_state_from_messages(self.file_state, prompt_messages)
257
258 session = create_provider_session(
259 model=model,
260 prompt_messages=prompt_messages,
261 should_generate_images=self.should_generate_images,
262 openai_api_key=self.openai_api_key,
263 openai_base_url=self.openai_base_url,
264 anthropic_api_key=self.anthropic_api_key,
265 gemini_api_key=self.gemini_api_key,
266 replicate_api_key=self.replicate_api_key,
267 )
268 try:
269 return await self._run_with_session(session)
270 finally:
271 await session.close()
272
273 async def _finalize_response(self, assistant_text: str) -> str:
274 if self.file_state.content:

Callers 5

start.pyFile · 0.80
run_evals.pyFile · 0.80
_run_variantMethod · 0.80
generate_code_for_imageFunction · 0.80

Calls 5

_extract_input_imagesMethod · 0.95
_run_with_sessionMethod · 0.95
create_provider_sessionFunction · 0.90
closeMethod · 0.45

Tested by

no test coverage detected