Skip to content

Commit b617f7d

Browse files
committed
text-to-blazor updates
1 parent a4f6c9b commit b617f7d

File tree

3 files changed

+37
-11
lines changed

3 files changed

+37
-11
lines changed

MyApp/Pages/TextToBlazor.cshtml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ green-500 #22c55e
2020
<div class="mx-auto px-4 sm:px-6 md:max-w-3xl md:px-4 lg:px-0">
2121
<h1 class="mb-8 text-6xl md:text-7xl font-bold tracking-tighter leading-tight">
2222
<label for="prompt" class="flex items-center">
23-
<a href="/imagine">
23+
<a href="/text-to-blazor">
2424
<img src="/img/svgs/blazor.svg" alt="Blazor Vue Logo" class="mr-4 w-20 h-20 inline-block align-middle">
2525
</a>
2626
Text to Blazor Vue App
@@ -65,7 +65,7 @@ green-500 #22c55e
6565

6666
<div class="mx-auto max-w-md px-4 text-center sm:max-w-3xl sm:px-6 lg:max-w-7xl lg:px-8">
6767
<div class="mt-5 mb-8 flex justify-center gap-8">
68-
<button id="btnGenerate" @@click="generate()" type="button" :disabled="!prompt || prompt == gist?.description || loadingGeneration"
68+
<button id="btnGenerate" @@click="generate($event)" type="button" :disabled="!prompt || prompt == gist?.description || loadingGeneration"
6969
class="cursor-pointer rounded-full bg-white dark:bg-slate-700 px-8 py-3 text-xl text-slate-600 hover:text-slate-800 disabled:text-slate-400 disabled:bg-gray-100 hover:bg-gray-50 border-2 border-indigo-500 disabled:border-slate-300 hover:border-green-500 rounded-md shadow disabled:shadow-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-300">
7070
Generate App
7171
</button>
@@ -135,7 +135,7 @@ green-500 #22c55e
135135
</div>
136136
</div>
137137
<div v-if="gist" v-cloak>
138-
<gist-view :gist="gist"></gist-view>
138+
<gist-view :gist="gist" :icon="getIcon(useModel)"></gist-view>
139139

140140
<div class="mt-4 flex justify-center items-center" v-cloak>
141141
<svg class="mr-1 w-5 h-5 text-indigo-600" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="m12 16l-5-5l1.4-1.45l2.6 2.6V4h2v8.15l2.6-2.6L17 11zm-6 4q-.825 0-1.412-.587T4 18v-3h2v3h12v-3h2v3q0 .825-.587 1.413T18 20z"/></svg>
@@ -256,6 +256,7 @@ export const icons = {
256256
'gemini-flash-1.5': '/img/models/gemini-pro.svg',
257257
'gemini-flash-1.5-8b': '/img/models/gemini-pro.svg',
258258
'gemini-pro-1.5': '/img/models/gemini-pro.svg',
259+
'gemini-flash-thinking-2.0': '/img/models/gemini-pro.svg',
259260
}
260261
261262
const app = new App()
@@ -359,10 +360,10 @@ const AppComponent = {
359360
return new Promise(resolve => setTimeout(resolve, ms));
360361
}
361362
362-
async function generate() {
363+
async function generate(e) {
363364
loadingGeneration.value = true
364365
await sleep(2000)
365-
let cached = true
366+
let cached = e.ctrlKey // hold CTRL to use cached model
366367
let generateModelsUrl = new URL('https://okai.servicestack.com/models/gist')
367368
function addQueryParams(args) {
368369
for (const [k,v] of Object.entries(args)) {
@@ -374,7 +375,7 @@ const AppComponent = {
374375
} else {
375376
addQueryParams({
376377
prompt: prompt.value,
377-
include: 'all',
378+
include: 'all,-header',
378379
project: project.value,
379380
template: 'blazor-vue'
380381
})

MyApp/wwwroot/mjs/components/GistView.mjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export default {
66
<div class="flex gap-x-1">
77
<div class="w-1/2">
88
<div class="flex justify-between items-center">
9-
<div class="mr-4">
9+
<div class="mr-4 flex items-center">
10+
<img v-if="icon" :src="icon" class="ml-1.5 size-5 shrink-0" :title="useModel + ' data models'">
1011
<h4 class="ml-2 text-sm font-semibold leading-7 text-gray-600">Data Models</h4>
1112
</div>
1213
<div>
@@ -51,12 +52,14 @@ export default {
5152
`,
5253
props: {
5354
gist: Object,
55+
icon: String,
5456
},
5557
setup(props) {
5658
const routes = inject('routes')
5759
let cmTsd, cmGen
5860
const refTsd = ref()
5961
const refGen = ref()
62+
const useModel = computed(() => rightPart(props.gist.owner,'/') ?? '')
6063

6164
function getLabel(path) {
6265
return path.endsWith('index.mjs')
@@ -138,6 +141,7 @@ export default {
138141

139142
return {
140143
routes,
144+
useModel,
141145
refTsd,
142146
refGen,
143147
tsdFileName,

MyApp/wwwroot/okai/accepted/index.json

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,24 +112,45 @@
112112
"groupName": "PostCategories"
113113
},
114114
{
115-
"id": "1735873704297",
115+
"id": "1735872878252",
116116
"model": "llama3.3:70b",
117117
"provider": "openrouter",
118118
"prompt": "Create a CMS to manage a website",
119-
"groupName": "Comments"
119+
"groupName": "MenuItems"
120120
},
121121
{
122-
"id": "1735872878252",
122+
"id": "1735873704297",
123123
"model": "llama3.3:70b",
124124
"provider": "openrouter",
125125
"prompt": "Create a CMS to manage a website",
126-
"groupName": "MenuItems"
126+
"groupName": "Comments"
127127
},
128128
{
129129
"id": "1736959853686",
130130
"model": "llama3.3:70b",
131131
"provider": "openrouter",
132132
"prompt": "Create an employee management, payroll and benefits administration App",
133133
"groupName": "EmployeeJobTitles"
134+
},
135+
{
136+
"id": "1736790645942",
137+
"model": "qwen2.5-coder:32b",
138+
"provider": "openrouter",
139+
"prompt": "create a job board",
140+
"groupName": "JobSkills"
141+
},
142+
{
143+
"id": "1737008556870",
144+
"model": "codestral:22b",
145+
"provider": "codestral",
146+
"prompt": "Create an internal Collaboration tool to Facilitate teamwork and communication among employees ",
147+
"groupName": "ProjectMembers"
148+
},
149+
{
150+
"id": "1737685678104",
151+
"model": "codestral:22b",
152+
"provider": "codestral",
153+
"prompt": "Create an employee self-service App with benefits enrollment, payroll access, and time-off requests",
154+
"groupName": "EmployeeBenefits"
134155
}
135156
]

0 commit comments

Comments
 (0)