Skip to content

Commit

Permalink
use ctx info for model switch
Browse files Browse the repository at this point in the history
  • Loading branch information
sceuick committed Sep 8, 2024
1 parent 0051f30 commit 01d3c0c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion web/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ const Navigation: Component = () => {
return true
})

const sha = createMemo(() => {
const apiSha = state.config.version.startsWith('development')
? 'dev'
: state.config.version.slice(0, 4)
const webSha = window.agnai_version.startsWith('{{')
? ''
: `/ ${window.agnai_version.slice(0, 4)}`

return `${apiSha} ${webSha}`
})

return (
<>
<Show when={!state.showMenu && dismissable()}>
Expand Down Expand Up @@ -229,7 +240,7 @@ const Navigation: Component = () => {
</div>
</Show>
<div class="text-500 mb-1 text-[0.6rem] italic" role="contentinfo" aria-label="Version">
{state.config.version}
{sha()}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion web/pages/Chat/ChatHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const ChatNav: Component<NavProps> = (props) => {
</Nav.Item>
</Show>

<Show when={props.ctx.preset?.service === 'agnaistic'}>
<Show when={props.ctx.info?.adapter === 'agnaistic'}>
<div class="flex w-full justify-center">
<AgnaisticModel inherit={props.ctx.preset} />
</div>
Expand Down

0 comments on commit 01d3c0c

Please sign in to comment.