backend changes extracted from codex/jon/SKY-5016 (#2508)
This commit is contained in:
@@ -48,6 +48,7 @@ from skyvern.forge.sdk.schemas.task_generations import GenerateTaskRequest, Task
|
||||
from skyvern.forge.sdk.schemas.task_v2 import TaskV2Request
|
||||
from skyvern.forge.sdk.schemas.tasks import (
|
||||
CreateTaskResponse,
|
||||
ModelsResponse,
|
||||
OrderBy,
|
||||
SortDirection,
|
||||
Task,
|
||||
@@ -794,6 +795,24 @@ async def heartbeat() -> Response:
|
||||
return Response(content="Server is running.", status_code=200, headers={"X-Skyvern-API-Version": __version__})
|
||||
|
||||
|
||||
@legacy_base_router.get(
|
||||
"/models",
|
||||
tags=["agent"],
|
||||
openapi_extra={
|
||||
"x-fern-sdk-group-name": "agent",
|
||||
},
|
||||
)
|
||||
@legacy_base_router.get("/models/", include_in_schema=False)
|
||||
async def models() -> ModelsResponse:
|
||||
"""
|
||||
Get a list of available models.
|
||||
"""
|
||||
mapping = settings.get_model_name_to_llm_key()
|
||||
models = list(mapping.keys())
|
||||
|
||||
return ModelsResponse(models=models)
|
||||
|
||||
|
||||
@legacy_base_router.post(
|
||||
"/tasks",
|
||||
tags=["agent"],
|
||||
|
||||
@@ -36,6 +36,8 @@ proxy_location: RESIDENTIAL
|
||||
webhook_callback_url: https://example.com/webhook
|
||||
totp_verification_url: https://example.com/totp
|
||||
persist_browser_session: false
|
||||
model:
|
||||
model: gpt-3.5-turbo
|
||||
workflow_definition:
|
||||
parameters:
|
||||
- key: website_url
|
||||
@@ -119,6 +121,7 @@ workflow_definition = {
|
||||
"webhook_callback_url": "https://example.com/webhook",
|
||||
"totp_verification_url": "https://example.com/totp",
|
||||
"totp_identifier": "4155555555",
|
||||
"model": {"model": "gpt-3.5-turbo"},
|
||||
"workflow_definition": {
|
||||
"parameters": [
|
||||
{
|
||||
@@ -201,6 +204,7 @@ proxy_location: RESIDENTIAL
|
||||
webhook_callback_url: https://example.com/webhook
|
||||
totp_verification_url: https://example.com/totp
|
||||
persist_browser_session: false
|
||||
model: {model: gpt-3.5-turbo}
|
||||
workflow_definition:
|
||||
parameters:
|
||||
- key: website_url
|
||||
@@ -283,6 +287,7 @@ updated_workflow_definition = {
|
||||
"webhook_callback_url": "https://example.com/webhook",
|
||||
"totp_verification_url": "https://example.com/totp",
|
||||
"totp_identifier": "4155555555",
|
||||
"model": {"model": "gpt-3.5-turbo"},
|
||||
"workflow_definition": {
|
||||
"parameters": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user