Skip to content

Commit

Permalink
Tools
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Fiduccia <[email protected]>
  • Loading branch information
vincent99 committed Jan 23, 2024
1 parent c1ae556 commit d654aa3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
15 changes: 14 additions & 1 deletion models/assistant.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import type { IResource } from '@/composables/steve/types'

declare global {
interface IParameter {
type: string
properties: object
}

interface ITool {
'function': {
description: string
name: string,
parameters: IParameter
}
type: string
}
interface IAssistant extends IResource {
spec: {
cache: boolean
Expand All @@ -11,7 +24,7 @@ declare global {
model: string
name: string
parameters: object
tools: object[]
tools: ITool[]
vision: boolean
}

Expand Down
8 changes: 7 additions & 1 deletion pages/a/[assistant].vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,13 @@ async function send(e: ChatEvent) {
<div>
<h1>{{assistant.spec.name}}</h1>
<h2>{{assistant.spec.description}}</h2>
<div>{{assistant.spec.instructions}}</div>

<h3 v-if="assistant.spec?.tools?.length">Available Tools:</h3>
<div class="border m-2" v-for="(t, idx) in assistant.spec.tools" :key="idx">
<code>
{{t['function'].name}}({{t['function'].parameters.type}})
</code>
</div>

<chat-input @message="send"/>
</div>
Expand Down

0 comments on commit d654aa3

Please sign in to comment.