Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

feat(copilot): generate personalized quick-action prompts from Tally business understanding (#12374)

Swifty1f1288d623f6
diff --git a/autogpt_platform/backend/backend/api/features/chat/routes.py b/autogpt_platform/backend/backend/api/features/chat/routes.py
index b348587c5f..b517ee5d06 100644
--- a/autogpt_platform/backend/backend/api/features/chat/routes.py
+++ b/autogpt_platform/backend/backend/api/features/chat/routes.py
@@ -54,6 +54,7 @@ from backend.copilot.tools.models import (
)
from backend.copilot.tracking import track_user_message
from backend.data.redis_client import get_redis_async
+from backend.data.understanding import get_business_understanding
from backend.data.workspace import get_or_create_workspace
from backend.util.exceptions import NotFoundError
@@ -853,6 +854,36 @@ async def session_assign_user(
return {"status": "ok"}
+# ========== Suggested Prompts ==========
+
+
+class SuggestedPromptsResponse(BaseModel):
+ """Response model for user-specific suggested prompts."""
+
+ prompts: list[str]
+
+
+ "/suggested-prompts",
+ dependencies=[Security(auth.requires_user)],
+)
+async def get_suggested_prompts(
+ user_id: Annotated[str, Security(auth.get_user_id)],
+) -> SuggestedPromptsResponse:
+ """
+ Get LLM-generated suggested prompts for the authenticated user.
+
+ Returns personalized quick-action prompts based on the user's
+ business understanding. Returns an empty list if no custom prompts
+ are available.
+ """
+ understanding = await get_business_understanding(user_id)
+ if understanding is None:
+ return SuggestedPromptsResponse(prompts=[])
+
+ return SuggestedPromptsResponse(prompts=understanding.suggested_prompts)
+
+
# ========== Configuration ==========
diff --git a/autogpt_platform/backend/backend/api/features/chat/routes_test.py b/autogpt_platform/backend/backend/api/features/chat/routes_test.py
index 80d8f2494c..497d7c5b12 100644
--- a/autogpt_platform/backend/backend/api/features/chat/routes_test.py
+++ b/autogpt_platform/backend/backend/api/features/chat/routes_test.py
@@ -1,6 +1,6 @@
-"""Tests for chat API routes: session title update and file attachment validation."""
+"""Tests for chat API routes: session title update, file attachment validation, and suggested prompts."""
-from unittest.mock import AsyncMock
+from unittest.mock import AsyncMock, MagicMock
import fastapi
import fastapi.testclient
@@ -249,3 +249,62 @@ def test_file_ids_scoped_to_workspace(mocker: pytest_mock.MockFixture):
call_kwargs = mock_prisma.find_many.call_args[1]
assert call_kwargs["where"]["workspaceId"] == "my-workspace-id"
assert call_kwargs["where"]["isDeleted"] is False
+
+
+# ─── Suggested prompts endpoint ──────────────────────────────────────
+
+
+def _mock_get_business_understanding(
+ mocker: pytest_mock.MockerFixture,
+ *,
+ return_value=None,
+):
+ """Mock get_business_understanding."""
+ return mocker.patch(
+ "backend.api.features.chat.routes.get_business_understanding",
+ new_callable=AsyncMock,
+ return_value=return_value,
+ )
+
+
+def test_suggested_prompts_returns_prompts(
+ mocker: pytest_mock.MockerFixture,
+ test_user_id: str,
+) -> None:
+ """User with understanding and prompts gets them back."""
+ mock_understanding = MagicMock()
+ mock_understanding.suggested_prompts = ["Do X", "Do Y", "Do Z"]
+ _mock_get_business_understanding(mocker, return_value=mock_understanding)
+
+ response = client.get("/suggested-prompts")
+
+ assert response.status_code == 200
+ assert response.json() == {"prompts": ["Do X", "Do Y", "Do Z"]}
+
+
+def test_suggested_prompts_no_understanding(
+ mocker: pytest_mock.MockerFixture,
+ test_user_id: str,
+) -> None:
+ """User with no understanding gets empty list."""
+ _mock_get_business_understanding(mocker, return_value=None)
+
+ response = client.get("/suggested-prompts")
+
+ assert response.status_code == 200
+ assert response.json() == {"prompts": []}
+
+
+def test_suggested_prompts_empty_prompts(
+ mocker: pytest_mock.MockerFixture,
+ test_user_id: str,
+) -> None:
+ """User with understanding but no prompts gets empty list."""
+ mock_understanding = MagicMock()
+ mock_understanding.suggested_prompts = []
+ _mock_get_business_understanding(mocker, return_value=mock_understanding)
+
+ response = client.get("/suggested-prompts")
+
+ assert response.status_code == 200
+ assert response.json() == {"prompts": []}
diff --git a/autogpt_platform/backend/backend/data/tally.py b/autogpt_platform/backend/backend/data/tally.py
index 814f886cf5..c198cd90ae 100644
--- a/autogpt_platform/backend/backend/data/tally.py
+++ b/autogpt_platform/backend/backend/data/tally.py
@@ -331,6 +331,9 @@ Fields:
- current_software (list of strings): software/tools currently used
- existing_automation (list of strings): existing automations
- additional_notes (string): any additional context
+- suggested_prompts (list of 5 strings): short action prompts (each under 20 words) that would help \
+this person get started with automating their work. Should be specific to their industry, role, and \
+pain points; actionable and conversational in tone; focused on automation opportunities.
Form data:
"""
@@ -338,10 +341,11 @@ Form data:
_EXTRACTION_SUFFIX = "\n\nReturn ONLY valid JSON."
-async def extract_business_understanding(
+async def extract_business_understanding_from_tally(
formatted_text: str,
) -> BusinessUnderstandingInput:
- """Use an LLM to extract structured business understanding from form text.
+ """
+ Use an LLM to extract structured business understanding from form text.
Raises on timeout or unparseable response so the caller can handle it.
"""
@@ -351,7 +355,7 @@ async def extract_business_understanding(
try:
response = await asyncio.wait_for(
client.chat.completions.create(
- model="openai/gpt-4o-mini",
+ model=_settings.config.tally_extraction_llm_model,
messages=[
{
"role": "user",
@@ -376,6 +380,26 @@ async def extract_business_understanding(
# Filter out null values before constructing
cleaned = {k: v for k, v in data.items() if v is not None}
+
+ # Validate suggested_prompts: filter >20 words, keep top 3
+ raw_prompts = cleaned.get("suggested_prompts", [])
+ if isinstance(raw_prompts, list):
+ valid = [
+ p.strip()
+ for p in raw_prompts
+ if isinstance(p, str) and len(p.strip().split()) <= 20
+ ]
+ # This will keep up to 3 suggestions
+ short_prompts = valid[:3] if valid else None
+ if short_prompts:
+ cleaned["suggested_prompts"] = short_prompts
+ else:
+ # We dont want to add a None value suggested_prompts field
+ cleaned.pop("suggested_prompts", None)
+ else:
+ # suggested_prompts must be a list - removing it as its not here
+ cleaned.pop("suggested_prompts", None)
+
return BusinessUnderstandingInput(**cleaned)
@@ -404,7 +428,7 @@ async def get_business_understanding_input_from_tally(
logger.warning("Tally: formatted submission was empty, skipping")
return None
- return await extract_business_understanding(formatted)
+ return await extract_business_understanding_from_tally(formatted)
async def populate_understanding_from_tally(user_id: str, email: str) -> None:
diff --git a/autogpt_platform/backend/backend/data/tally_test.py b/autogpt_platform/backend/backend/data/tally_test.py
index bbed42f88a..12324a3674 100644
--- a/autogpt_platform/backend/backend/data/tally_test.py
+++ b/autogpt_platform/backend/backend/data/tally_test.py
@@ -13,7 +13,7 @@ from backend.data.tally import (
_format_answer,
_make_tally_client,
_refresh_cache,
- extract_business_understanding,
+ extract_business_understanding_from_tally,
find_submission_by_email,
format_submission_for_llm,
mask_email,
@@ -284,6 +284,7 @@ async def test_populate_understanding_full_flow():
],
}
mock_input = MagicMock()
+ mock_input.suggested_prompts = ["Prompt 1", "Prompt 2", "Prompt 3"]
with (
patch(
@@ -298,7 +299,7 @@ async def test_populate_understanding_full_flow():
return_value=(submission, SAMPLE_QUESTIONS),
),
patch(
- "backend.data.tally.extract_business_understanding",
+ "backend.data.tally.extract_business_understanding_from_tally",
new_callable=AsyncMock,
return_value=mock_input,
) as mock_extract,
@@ -338,7 +339,7 @@ async def test_populate_understanding_handles_llm_timeout():
return_value=(submission, SAMPLE_QUESTIONS),
),
patch(
- "backend.data.tally.extract_business_understanding",
+ "backend.data.tally.extract_business_understanding_from_tally",
new_callable=AsyncMock,
side_effect=asyncio.TimeoutError(),
),
@@ -393,11 +394,11 @@ def test_extraction_prompt_no_format_placeholders():
assert single_braces == [], f"Found format placeholders: {single_braces}"
-# ── extract_business_understanding ────────────────────────────────────────────
+# ── extract_business_understanding_from_tally ────────────────────────────────────────────
@pytest.mark.asyncio
-async def test_extract_business_understanding_success():
+async def test_extract_business_understanding_from_tally_success():
"""Happy path: LLM returns valid JSON that maps to BusinessUnderstandingInput."""
mock_choice = MagicMock()
mock_choice.message.content = json.dumps(
@@ -406,6 +407,13 @@ async def test_extract_business_understanding_success():
"business_name": "Acme Corp",
"industry": "Technology",
"pain_points": ["manual reporting"],
+ "suggested_prompts": [
+ "Automate weekly reports",
+ "Set up invoice processing",
+ "Create a customer onboarding flow",
+ "Track project deadlines automatically",
+ "Send follow-up emails after meetings",
+ ],
}
)
mock_response = MagicMock()
@@ -415,16 +423,56 @@ async def test_extract_business_understanding_success():
mock_client.chat.completions.create.return_value = mock_response
with patch("backend.data.tally.AsyncOpenAI", return_value=mock_client):
- result = await extract_business_understanding("Q: Name?\nA: Alice")
+ result = await extract_business_understanding_from_tally("Q: Name?\nA: Alice")
assert result.user_name == "Alice"
assert result.business_name == "Acme Corp"
assert result.industry == "Technology"
assert result.pain_points == ["manual reporting"]
+ # suggested_prompts validated and sliced to top 3
+ assert result.suggested_prompts == [
+ "Automate weekly reports",
+ "Set up invoice processing",
+ "Create a customer onboarding flow",
+ ]
+
+
+async def test_extract_business_understanding_from_tally_filters_long_prompts():
+ """Prompts exceeding 20 words are excluded and only top 3 are kept."""
+ long_prompt = " ".join(["word"] * 21)
+ mock_choice = MagicMock()
+ mock_choice.message.content = json.dumps(
+ {
+ "user_name": "Alice",
+ "suggested_prompts": [
+ long_prompt,
+ "Short prompt one",
+ long_prompt,
+ "Short prompt two",
+ "Short prompt three",
+ "Short prompt four",
+ ],
+ }
+ )
+ mock_response = MagicMock()
+ mock_response.choices = [mock_choice]
+
+ mock_client = AsyncMock()
+ mock_client.chat.completions.create.return_value = mock_response
+
+ with patch("backend.data.tally.AsyncOpenAI", return_value=mock_client):
+ result = await extract_business_understanding_from_tally("Q: Name?\nA: Alice")
+
+ assert result.suggested_prompts == [
+ "Short prompt one",
+ "Short prompt two",
+ "Short prompt three",
+ ]
@pytest.mark.asyncio
-async def test_extract_business_understanding_filters_nulls():
+async def test_extract_business_understanding_from_tally_filters_nulls():
"""Null values from LLM should be excluded from the result."""
mock_choice = MagicMock()
mock_choice.message.content = json.dumps(
@@ -437,7 +485,7 @@ async def test_extract_business_understanding_filters_nulls():
mock_client.chat.completions.create.return_value = mock_response
with patch("backend.data.tally.AsyncOpenAI", return_value=mock_client):
- result = await extract_business_understanding("Q: Name?\nA: Alice")
+ result = await extract_business_understanding_from_tally("Q: Name?\nA: Alice")
assert result.user_name == "Alice"
assert result.business_name is None
@@ -445,7 +493,7 @@ async def test_extract_business_understanding_filters_nulls():
@pytest.mark.asyncio
-async def test_extract_business_understanding_invalid_json():
+async def test_extract_business_understanding_from_tally_invalid_json():
"""Invalid JSON from LLM should raise JSONDecodeError."""
mock_choice = MagicMock()
mock_choice.message.content = "not valid json {"
@@ -459,11 +507,11 @@ async def test_extract_business_understanding_invalid_json():
patch("backend.data.tally.AsyncOpenAI", return_value=mock_client),
pytest.raises(json.JSONDecodeError),
):
- await extract_business_understanding("Q: Name?\nA: Alice")
+ await extract_business_understanding_from_tally("Q: Name?\nA: Alice")
@pytest.mark.asyncio
-async def test_extract_business_understanding_timeout():
+async def test_extract_business_understanding_from_tally_timeout():
"""LLM timeout should propagate as asyncio.TimeoutError."""
mock_client = AsyncMock()
mock_client.chat.completions.create.side_effect = asyncio.TimeoutError()
@@ -473,7 +521,7 @@ async def test_extract_business_understanding_timeout():
patch("backend.data.tally._LLM_TIMEOUT", 0.001),
pytest.raises(asyncio.TimeoutError),
):
- await extract_business_understanding("Q: Name?\nA: Alice")
+ await extract_business_understanding_from_tally("Q: Name?\nA: Alice")
# ── _refresh_cache ───────────────────────────────────────────────────────────
diff --git a/autogpt_platform/backend/backend/data/understanding.py b/autogpt_platform/backend/backend/data/understanding.py
index 07a8196ca3..21cb46ffa6 100644
--- a/autogpt_platform/backend/backend/data/understanding.py
+++ b/autogpt_platform/backend/backend/data/understanding.py
@@ -86,6 +86,11 @@ class BusinessUnderstandingInput(pydantic.BaseModel):
None, description="Any additional context"
)
+ # Suggested prompts (UI-only, not included in system prompt)
+ suggested_prompts: Optional[list[str]] = pydantic.Field(
+ None, description="LLM-generated suggested prompts based on business context"
+ )
+
class BusinessUnderstanding(pydantic.BaseModel):
"""Full business understanding model returned from database."""
@@ -122,6 +127,9 @@ class BusinessUnderstanding(pydantic.BaseModel):
# Additional context
additional_notes: Optional[str] = None
+ # Suggested prompts (UI-only, not included in system prompt)
+ suggested_prompts: list[str] = pydantic.Field(default_factory=list)
+
@classmethod
def from_db(cls, db_record: CoPilotUnderstanding) -> "BusinessUnderstanding":
"""Convert database record to Pydantic model."""
@@ -149,6 +157,7 @@ class BusinessUnderstanding(pydantic.BaseModel):
current_software=_json_to_list(business.get("current_software")),
existing_automation=_json_to_list(business.get("existing_automation")),
additional_notes=business.get("additional_notes"),
+ suggested_prompts=_json_to_list(data.get("suggested_prompts")),
)
@@ -213,6 +222,12 @@ def merge_business_understanding_data(
merged_business["version"] = 1
merged_data["business"] = merged_business
+ # suggested_prompts lives at the top level (not under `business`) because
+ # it's a UI-only artifact consumed by the frontend, not business understanding
+ # data. The `business` sub-dict feeds the system prompt.
+ if input_data.suggested_prompts is not None:
+ merged_data["suggested_prompts"] = input_data.suggested_prompts
+
return merged_data
diff --git a/autogpt_platform/backend/backend/data/understanding_test.py b/autogpt_platform/backend/backend/data/understanding_test.py
new file mode 100644
index 0000000000..e22659322b
--- /dev/null
+++ b/autogpt_platform/backend/backend/data/understanding_test.py
@@ -0,0 +1,102 @@
+"""Tests for business understanding merge and format logic."""
+
+from datetime import datetime, timezone
+from typing import Any
+
+from backend.data.understanding import (
+ BusinessUnderstanding,
+ BusinessUnderstandingInput,
+ format_understanding_for_prompt,
+ merge_business_understanding_data,
+)
+
+
+def _make_input(**kwargs: Any) -> BusinessUnderstandingInput:
+ """Create a BusinessUnderstandingInput with only the specified fields."""
+ return BusinessUnderstandingInput.model_validate(kwargs)
+
+
+# ─── merge_business_understanding_data: suggested_prompts ─────────────
+
+
+def test_merge_suggested_prompts_overwrites_existing():
+ """New suggested_prompts should fully replace existing ones (not append)."""
+ existing = {
+ "name": "Alice",
+ "business": {"industry": "Tech", "version": 1},
+ "suggested_prompts": ["Old prompt 1", "Old prompt 2"],
+ }
+ input_data = _make_input(
+ suggested_prompts=["New prompt A", "New prompt B", "New prompt C"],
+ )
+
+ result = merge_business_understanding_data(existing, input_data)
+
+ assert result["suggested_prompts"] == [
+ "New prompt A",
+ "New prompt B",
+ "New prompt C",
+ ]
+
+
+def test_merge_suggested_prompts_none_preserves_existing():
+ """When input has suggested_prompts=None, existing prompts are preserved."""
+ existing = {
+ "name": "Alice",
+ "business": {"industry": "Tech", "version": 1},
+ "suggested_prompts": ["Keep me"],
+ }
+ input_data = _make_input(industry="Finance")
+
+ result = merge_business_understanding_data(existing, input_data)
+
+ assert result["suggested_prompts"] == ["Keep me"]
+ assert result["business"]["industry"] == "Finance"
+
+
+def test_merge_suggested_prompts_added_to_empty_data():
+ """Suggested prompts are set at top level even when starting from empty data."""
+ existing: dict[str, Any] = {}
+ input_data = _make_input(suggested_prompts=["Prompt 1"])
+
+ result = merge_business_understanding_data(existing, input_data)
+
+ assert result["suggested_prompts"] == ["Prompt 1"]
+
+
+def test_merge_suggested_prompts_empty_list_overwrites():
+ """An explicit empty list should overwrite existing prompts."""
+ existing: dict[str, Any] = {
+ "suggested_prompts": ["Old prompt"],
+ "business": {"version": 1},
+ }
+ input_data = _make_input(suggested_prompts=[])
+
+ result = merge_business_understanding_data(existing, input_data)
+
+ assert result["suggested_prompts"] == []
+
+
+# ─── format_understanding_for_prompt: excludes suggested_prompts ──────
+
+
+def test_format_understanding_excludes_suggested_prompts():
+ """suggested_prompts is UI-only and must NOT appear in the system prompt."""
+ understanding = BusinessUnderstanding(
+ id="test-id",
+ user_id="user-1",
+ created_at=datetime.now(tz=timezone.utc),
+ updated_at=datetime.now(tz=timezone.utc),
+ user_name="Alice",
+ industry="Technology",
+ suggested_prompts=["Automate reports", "Set up alerts", "Track KPIs"],
+ )
+
+ formatted = format_understanding_for_prompt(understanding)
+
+ assert "Alice" in formatted
+ assert "Technology" in formatted
+ assert "suggested_prompts" not in formatted
+ assert "Automate reports" not in formatted
+ assert "Set up alerts" not in formatted
+ assert "Track KPIs" not in formatted
diff --git a/autogpt_platform/backend/backend/util/settings.py b/autogpt_platform/backend/backend/util/settings.py
index b7e4d5c8a8..de9021dc79 100644
--- a/autogpt_platform/backend/backend/util/settings.py
+++ b/autogpt_platform/backend/backend/util/settings.py
@@ -89,6 +89,10 @@ class Config(UpdateTrackingModel["Config"], BaseSettings):
le=500,
description="Thread pool size for FastAPI sync operations. All sync endpoints and dependencies automatically use this pool. Higher values support more concurrent sync operations but use more memory.",
)
+ tally_extraction_llm_model: str = Field(
+ default="openai/gpt-4o-mini",
+ description="OpenRouter model ID used for extracting business understanding from Tally form data",
+ )
ollama_host: str = Field(
default="localhost:11434",
description="Default Ollama host; exempted from SSRF checks.",
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx
index 09689305da..60d202f255 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/EmptySession.tsx
@@ -1,7 +1,9 @@
"use client";
+import { useGetV2GetSuggestedPrompts } from "@/app/api/__generated__/endpoints/chat/chat";
import { ChatInput } from "@/app/(platform)/copilot/components/ChatInput/ChatInput";
import { Button } from "@/components/atoms/Button/Button";
+import { Skeleton } from "@/components/atoms/Skeleton/Skeleton";
import { Text } from "@/components/atoms/Text/Text";
import { useSupabase } from "@/lib/supabase/hooks/useSupabase";
import { SpinnerGapIcon } from "@phosphor-icons/react";
@@ -33,15 +35,38 @@ export function EmptySession({
}: Props) {
const { user } = useSupabase();
const greetingName = getGreetingName(user);
- const quickActions = getQuickActions();
+
+ const { data: suggestedPromptsResponse, isLoading: isLoadingPrompts } =
+ useGetV2GetSuggestedPrompts({
+ query: { staleTime: Infinity },
+ });
+ const customPrompts =
+ suggestedPromptsResponse?.status === 200
+ ? suggestedPromptsResponse.data.prompts
+ : undefined;
+ const quickActions = getQuickActions(customPrompts);
const [loadingAction, setLoadingAction] = useState<string | null>(null);
const [inputPlaceholder, setInputPlaceholder] = useState(
getInputPlaceholder(),
);
+ // Use matchMedia instead of resize event — fires only when crossing
+ // the 500px and 1081px breakpoints defined in getInputPlaceholder(),
+ // rather than dozens of times per second during a window drag.
useEffect(() => {
- setInputPlaceholder(getInputPlaceholder(window.innerWidth));
- }, [window.innerWidth]);
+ function update() {
+ setInputPlaceholder(getInputPlaceholder(window.innerWidth));
+ }
+ const mq500 = window.matchMedia("(min-width: 500px)");
+ const mq1081 = window.matchMedia("(min-width: 1081px)");
+ update();
+ mq500.addEventListener("change", update);
+ mq1081.addEventListener("change", update);
+ return () => {
+ mq500.removeEventListener("change", update);
+ mq1081.removeEventListener("change", update);
+ };
+ }, []);
async function handleQuickActionClick(action: string) {
if (isCreatingSession || loadingAction) return;
@@ -91,28 +116,32 @@ export function EmptySession({
</div>
<div className="flex flex-wrap items-center justify-center gap-3 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden">
- {quickActions.map((action) => (
- <Button
- key={action}
- type="button"
- variant="outline"
- size="small"
- onClick={() => void handleQuickActionClick(action)}
- disabled={isCreatingSession || loadingAction !== null}
- aria-busy={loadingAction === action}
- leftIcon={
- loadingAction === action ? (
- <SpinnerGapIcon
- className="h-4 w-4 animate-spin"
- weight="bold"
- />
- ) : null
- }
- className="h-auto shrink-0 border-zinc-300 px-3 py-2 text-[.9rem] text-zinc-600"
- >
- {action}
- </Button>
- ))}
+ {isLoadingPrompts
+ ? Array.from({ length: 3 }, (_, i) => (
+ <Skeleton key={i} className="h-10 w-64 shrink-0 rounded-full" />
+ ))
+ : quickActions.map((action) => (
+ <Button
+ key={action}
+ type="button"
+ variant="outline"
+ size="small"
+ onClick={() => void handleQuickActionClick(action)}
+ disabled={isCreatingSession || loadingAction !== null}
+ aria-busy={loadingAction === action}
+ leftIcon={
+ loadingAction === action ? (
+ <SpinnerGapIcon
+ className="h-4 w-4 animate-spin"
+ weight="bold"
+ />
+ ) : null
+ }
+ className="h-auto shrink-0 border-zinc-300 px-3 py-2 text-[.9rem] text-zinc-600"
+ >
+ {action}
+ </Button>
+ ))}
</div>
</motion.div>
</div>
diff --git a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/helpers.ts b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/helpers.ts
index f6f8980fd4..8b9279c173 100644
--- a/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/helpers.ts
+++ b/autogpt_platform/frontend/src/app/(platform)/copilot/components/EmptySession/helpers.ts
@@ -12,12 +12,17 @@ export function getInputPlaceholder(width?: number) {
return "What's your role and what eats up most of your day? e.g. 'I'm a recruiter and I hate...'";
}
-export function getQuickActions() {
- return [
- "I don't know where to start, just ask me stuff",
- "I do the same thing every week and it's killing me",
- "Help me find where I'm wasting my time",
- ];
+const DEFAULT_QUICK_ACTIONS = [
+ "I don't know where to start, just ask me stuff",
+ "I do the same thing every week and it's killing me",
+ "Help me find where I'm wasting my time",
+];
+
+export function getQuickActions(customPrompts?: string[]) {
+ if (customPrompts && customPrompts.length > 0) {
+ return customPrompts;
+ }
+ return DEFAULT_QUICK_ACTIONS;
}
export function getGreetingName(user?: User | null) {
diff --git a/autogpt_platform/frontend/src/app/api/openapi.json b/autogpt_platform/frontend/src/app/api/openapi.json
index b8d0a7a74b..6752073666 100644
--- a/autogpt_platform/frontend/src/app/api/openapi.json
+++ b/autogpt_platform/frontend/src/app/api/openapi.json
@@ -1358,6 +1358,30 @@
}
}
},
+ "/api/chat/suggested-prompts": {
+ "get": {
+ "tags": ["v2", "chat", "chat"],
+ "summary": "Get Suggested Prompts",
+ "description": "Get LLM-generated suggested prompts for the authenticated user.\n\nReturns personalized quick-action prompts based on the user's\nbusiness understanding. Returns an empty list if no custom prompts\nare available.",
+ "operationId": "getV2GetSuggestedPrompts",
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/SuggestedPromptsResponse"
+ }
+ }
+ }
+ },
+ "401": {
+ "$ref": "#/components/responses/HTTP401NotAuthenticatedError"
+ }
+ },
+ "security": [{ "HTTPBearerJWT": [] }]
+ }
+ },
"/api/credits": {
"get": {
"tags": ["v1", "credits"],
@@ -13010,6 +13034,19 @@
"title": "SuggestedGoalResponse",
"description": "Response when the goal needs refinement with a suggested alternative."
},
+ "SuggestedPromptsResponse": {
+ "properties": {
+ "prompts": {
+ "items": { "type": "string" },
+ "type": "array",
+ "title": "Prompts"
+ }
+ },
+ "type": "object",
+ "required": ["prompts"],
+ "title": "SuggestedPromptsResponse",
+ "description": "Response model for user-specific suggested prompts."
+ },
"SuggestionsResponse": {
"properties": {
"recent_searches": {