File tree Expand file tree Collapse file tree 6 files changed +32
-16
lines changed Expand file tree Collapse file tree 6 files changed +32
-16
lines changed Original file line number Diff line number Diff line change @@ -89,9 +89,10 @@ type Prompt struct {
89
89
90
90
// Field should match exactly what is in the GPTScript SDK
91
91
type Field struct {
92
- Name string `json:"name,omitempty"`
93
- Sensitive * bool `json:"sensitive,omitempty"`
94
- Description string `json:"description,omitempty"`
92
+ Name string `json:"name,omitempty"`
93
+ Sensitive * bool `json:"sensitive,omitempty"`
94
+ Description string `json:"description,omitempty"`
95
+ Options []string `json:"options,omitempty"`
95
96
}
96
97
97
98
type Fields []Field
@@ -103,6 +104,7 @@ func ToFields(fields gptscript.Fields) Fields {
103
104
Name : field .Name ,
104
105
Sensitive : field .Sensitive ,
105
106
Description : field .Description ,
107
+ Options : field .Options ,
106
108
}
107
109
}
108
110
return f
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ require (
17
17
github.com/google/uuid v1.6.0
18
18
github.com/gptscript-ai/chat-completion-client v0.0.0-20250224164718-139cb4507b1d
19
19
github.com/gptscript-ai/cmd v0.0.0-20250122115124-a3d65e9d2432
20
- github.com/gptscript-ai/go-gptscript v0.9.6-0.20250314150104-8d1f06fa87a4
21
- github.com/gptscript-ai/gptscript v0.9.6-0.20250322192245-31ce029b1eb6
20
+ github.com/gptscript-ai/go-gptscript v0.9.6-0.20250331192455-415de950d72d
21
+ github.com/gptscript-ai/gptscript v0.9.6-0.20250328194144-ce3b7262ed0e
22
22
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de
23
23
github.com/mhale/smtpd v0.8.3
24
24
github.com/obot-platform/kinm v0.0.0-20250307141751-3a6f13867f67
Original file line number Diff line number Diff line change @@ -297,10 +297,10 @@ github.com/gptscript-ai/chat-completion-client v0.0.0-20250224164718-139cb4507b1
297
297
github.com/gptscript-ai/chat-completion-client v0.0.0-20250224164718-139cb4507b1d /go.mod h1:7P/o6/IWa1KqsntVf68hSnLKuu3+xuqm6lYhch1w4jo =
298
298
github.com/gptscript-ai/cmd v0.0.0-20250122115124-a3d65e9d2432 h1:cJh/Hl1HFd1qLpdkaZvsFTC2mXlIuiK7FgvSfaSOWmw =
299
299
github.com/gptscript-ai/cmd v0.0.0-20250122115124-a3d65e9d2432 /go.mod h1:DJAo1xTht1LDkNYFNydVjTHd576TC7MlpsVRl3oloVw =
300
- github.com/gptscript-ai/go-gptscript v0.9.6-0.20250314150104-8d1f06fa87a4 h1:V30gwE9c6yEYQmWoKCvrfpGmsTTlEicHr5nGJZV4Uyk =
301
- github.com/gptscript-ai/go-gptscript v0.9.6-0.20250314150104-8d1f06fa87a4 /go.mod h1:QvGPZoRuAiA8P5EzPI05kTrs+LZ0ipHywUGsKruSknw =
302
- github.com/gptscript-ai/gptscript v0.9.6-0.20250322192245-31ce029b1eb6 h1:Y2LRTmdOgN30tfGOJ5HD/xdeXJGx2Q39w9TCQdXT5iU =
303
- github.com/gptscript-ai/gptscript v0.9.6-0.20250322192245-31ce029b1eb6 /go.mod h1:wQ9GU40Po6fSBEciAQI2kxeo32qK4DybbpD6bIOBPtM =
300
+ github.com/gptscript-ai/go-gptscript v0.9.6-0.20250331192455-415de950d72d h1:S9gfdnk0VK3dSFOHn/rhPWBbbOoC64uy38rRKIPLLcQ =
301
+ github.com/gptscript-ai/go-gptscript v0.9.6-0.20250331192455-415de950d72d /go.mod h1:QvGPZoRuAiA8P5EzPI05kTrs+LZ0ipHywUGsKruSknw =
302
+ github.com/gptscript-ai/gptscript v0.9.6-0.20250328194144-ce3b7262ed0e h1:v0j1Vb1g6zVN4YbcV8kBc/nJRXiy5kWOTBnEW+vAbvs =
303
+ github.com/gptscript-ai/gptscript v0.9.6-0.20250328194144-ce3b7262ed0e /go.mod h1:wQ9GU40Po6fSBEciAQI2kxeo32qK4DybbpD6bIOBPtM =
304
304
github.com/gptscript-ai/tui v0.0.0-20250204145344-33cd15de4cee h1:70PHW6Xw70yNNZ5aX936XqcMLwNmfMZpCV3FCOGKpxE =
305
305
github.com/gptscript-ai/tui v0.0.0-20250204145344-33cd15de4cee /go.mod h1:iwHxuueg2paOak7zIg0ESBWx7A0wIHGopAratbgaPNY =
306
306
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM =
Original file line number Diff line number Diff line change 423
423
{#each msg .fields as field }
424
424
<div class =" flex flex-col gap-1" >
425
425
<label for ={field .name } class ="mt-1 text-sm font-medium" >{field .name }</label >
426
- <input
427
- class =" rounded-lg bg-white p-2 outline-hidden dark:bg-gray-900"
428
- type ={field .sensitive ? ' password' : ' text' }
429
- name ={field .name }
430
- bind:value ={promptCredentials [field .name ]}
431
- />
426
+ {#if field .options }
427
+ <div class =" flex flex-col gap-2" >
428
+ {#each field .options as option }
429
+ <button class ="button" onclick ={() => (promptCredentials [field .name ] = option )}>
430
+ {option }
431
+ </button >
432
+ {/each }
433
+ </div >
434
+ {:else }
435
+ <input
436
+ class =" rounded-lg bg-white p-2 outline-hidden dark:bg-gray-900"
437
+ type ={field .sensitive ? ' password' : ' text' }
438
+ name ={field .name }
439
+ bind:value ={promptCredentials [field .name ]}
440
+ />
441
+ {/if }
432
442
{#if field .description }
433
443
<p class ="text-sm text-gray-500" >{field .description }</p >
434
444
{/if }
Original file line number Diff line number Diff line change 17
17
}
18
18
</script >
19
19
20
- <dialog bind:this ={dialog } class =" h-1/4 min-h-[300px] w-1/3 min-w-[300px] overflow-visible p-5" >
20
+ <dialog
21
+ bind:this ={dialog }
22
+ class =" max-h-[90vh] min-h-[300px] w-1/3 min-w-[300px] overflow-visible p-5"
23
+ >
21
24
<div class =" flex h-full flex-col" >
22
25
<button class ="absolute top-0 right-0 p-3" onclick ={() => dialog ?.close ()}>
23
26
<X class =" icon-default" />
Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ type PromptField = {
45
45
name : string ;
46
46
description ?: string ;
47
47
sensitive ?: boolean ;
48
+ options ?: string [ ] ;
48
49
} ;
49
50
50
51
type ToolInput = {
You can’t perform that action at this time.
0 commit comments