Skip to content

Commit aa824d1

Browse files
committed
Agent chip for templates
1 parent fdd9352 commit aa824d1

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

llmstack/apps/apis.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,9 @@ def getTemplates(self, request, slug=None):
258258
# When listing, do not show pages and app
259259
app_template_dict = app_template.dict()
260260
app_template_dict.pop('pages')
261-
app_template_dict.pop('app')
262-
json_data.append(app_template_dict)
261+
app = app_template_dict.pop('app')
262+
json_data.append(
263+
{**app_template_dict, **{"app": {"type_slug": app["type_slug"]}}})
263264

264265
return DRFResponse(json_data)
265266

@@ -515,10 +516,11 @@ async def run_app_internal_async(self, uid, session_id, request_uuid, request, p
515516
def run_app_internal(self, uid, session_id, request_uuid, request, platform=None, preview=False):
516517
app = get_object_or_404(App, uuid=uuid.UUID(uid))
517518
app_owner = get_object_or_404(Profile, user=app.owner)
518-
519+
519520
if (flag_enabled('HAS_EXCEEDED_MONTHLY_PROCESSOR_RUN_QUOTA', request=request, user=app.owner)):
520-
raise Exception('You have exceeded your monthly processor run quota. Please upgrade your plan to continue using the platform.')
521-
521+
raise Exception(
522+
'You have exceeded your monthly processor run quota. Please upgrade your plan to continue using the platform.')
523+
522524
app_data_obj = AppData.objects.filter(
523525
app_uuid=app.uuid, is_draft=preview).order_by('-created_at').first()
524526

@@ -552,16 +554,15 @@ def run_discord(self, request, uid):
552554
@action(detail=True, methods=['post'])
553555
def run_slack(self, request, uid):
554556
return self.run(request, uid, platform='slack')
555-
557+
556558
@action(detail=True, methods=['post'])
557559
def run_twiliosms(self, request, uid):
558560
result = self.run(request, uid, platform='twilio-sms')
559561
return DRFResponse(status=204, headers={'Content-Type': 'text/xml'})
560-
562+
561563
@action(detail=True, methods=['post'])
562564
def run_twiliovoice(self, request, uid):
563565
raise NotImplementedError()
564-
565566

566567
def testsets(self, request, uid):
567568
app = get_object_or_404(App, uuid=uuid.UUID(uid))

llmstack/client/src/components/apps/AppTemplatesList.jsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useCallback, useEffect, useState } from "react";
2-
import { Card, CardContent, Stack, Typography } from "@mui/material";
2+
import { Card, CardContent, Chip, Stack, Typography } from "@mui/material";
33
import { useNavigate, useParams } from "react-router-dom";
44
import { axios } from "../../data/axios";
55
import { AppFromTemplateDialog } from "./AppFromTemplateDialog";
@@ -122,6 +122,20 @@ export function AppTemplatesList() {
122122
>
123123
{template.name}
124124
</Typography>
125+
{template.app?.type_slug === "agent" && (
126+
<Chip
127+
label="Agent"
128+
size="small"
129+
style={{
130+
margin: "auto",
131+
padding: "5px 0",
132+
borderRadius: "3px",
133+
backgroundColor: "#ffdca4",
134+
fontSize: "12px",
135+
color: "#555",
136+
}}
137+
/>
138+
)}
125139
<Typography variant="caption" color="text.secondary">
126140
{template.description || template.app?.type.description}
127141
</Typography>

0 commit comments

Comments
 (0)