[SKV-3992] Add OPENAI_COMPATIBLE for githubcopilot.com (#3993)

This commit is contained in:
Aaron Perez
2026-02-13 18:29:19 -05:00
committed by GitHub
parent 1263c09aab
commit 3d4192cc38
6 changed files with 121 additions and 56 deletions

View File

@@ -15,6 +15,15 @@ from skyvern.forge.sdk.api.llm.exceptions import EmptyLLMResponseError, InvalidL
LOG = structlog.get_logger()
def is_image_message(message: dict[str, Any]) -> bool:
"""Check if message contains an image."""
return (
message.get("role") == "user"
and isinstance(message.get("content"), list)
and any(item.get("type") == "image_url" for item in message["content"])
)
async def llm_messages_builder(
prompt: str,
screenshots: list[bytes] | None = None,