mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-05 00:03:08 +00:00
556b4a41a1
* wip: openai proxy and other ai proxy integration * fixing migration script * wip: support different ai provider in front, fix proxy openai * wip: adding frontend ai provider * updated copilot types * wip: working on anthropic integration * done AI proxy front * adding new type and support for anthropic * updating gitignore * adding streaming response * added streaming prompt * push lib/gen * wip: fixing anthropic * anthropic fully supported * fix backend missing var error and fully support stream event for anthropic * remove gen directory * fixing openapi file * add support for mistral, and update create workspace components * remove deref.json * remove package-json * openapi * fix ui enable code * added utility function for init workspace ai provider * fix workspace switch bug * update anthropic property and fixed frontend error * fix workspace settings * update error message and fix typo migration file * chore: update openapi file * fix dev file * add .sqlx * all * update sqlx --------- Co-authored-by: dieriba <t.dieriba@gmail.com> Co-authored-by: Ruben Fiszel <ruben@windmill.dev> Co-authored-by: Ruben Fiszel <ruben@rubenfiszel.com>
60 lines
1.8 KiB
Svelte
60 lines
1.8 KiB
Svelte
<script lang="ts">
|
|
import Menu from '$lib/components/common/menu/Menu.svelte'
|
|
import type { FlowCopilotContext } from '$lib/components/copilot/flow'
|
|
import Popover from '$lib/components/Popover.svelte'
|
|
import { getContext } from 'svelte'
|
|
import { copilotInfo } from '$lib/stores'
|
|
import { ExternalLink, Wand2 } from 'lucide-svelte'
|
|
import { base } from '$lib/base'
|
|
|
|
let openNoCopilot = false
|
|
export let className = ''
|
|
|
|
const { drawerStore: copilotDrawerStore } =
|
|
getContext<FlowCopilotContext | undefined>('FlowCopilotContext') || {}
|
|
</script>
|
|
|
|
<div class={className}>
|
|
<Popover>
|
|
<div class={openNoCopilot ? 'z-10' : ''}>
|
|
<Menu pointerDown noMinW placement="bottom-center" let:close bind:show={openNoCopilot}>
|
|
<button
|
|
title="AI Flow Builder"
|
|
on:pointerdown={$copilotInfo.exists_ai_resource
|
|
? (ev) => {
|
|
ev.preventDefault()
|
|
ev.stopPropagation()
|
|
$copilotDrawerStore?.openDrawer()
|
|
}
|
|
: undefined}
|
|
slot="trigger"
|
|
type="button"
|
|
class=" bg-surface text-violet-800 dark:text-violet-400 border mx-0.5 focus:outline-none hover:bg-surface-hover focus:ring-4 focus:ring-gray-200 font-medium rounded-full text-sm w-7 h-7 flex items-center justify-center"
|
|
>
|
|
<Wand2 size={12} />
|
|
</button>
|
|
{#if !$copilotInfo.exists_ai_resource}
|
|
<div class="text-primary p-4">
|
|
<p class="text-sm w-80">
|
|
Enable Windmill AI in the
|
|
<a
|
|
href="{base}/workspace_settings?tab=ai"
|
|
target="_blank"
|
|
class="inline-flex flex-row items-center gap-1"
|
|
on:click={() => {
|
|
close()
|
|
}}
|
|
>
|
|
workspace settings
|
|
<ExternalLink size={16} />
|
|
</a>
|
|
</p>
|
|
</div>
|
|
{/if}
|
|
</Menu>
|
|
</div>
|
|
|
|
<svelte:fragment slot="text">AI Flow builder</svelte:fragment>
|
|
</Popover>
|
|
</div>
|