-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
259 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { SiAmazonaws, SiOpenai } from '@icons-pack/react-simple-icons'; | ||
import { memo } from 'react'; | ||
|
||
import { ModelProvider } from '@/libs/agent-runtime'; | ||
|
||
import { Anthropic } from './Anthropic'; | ||
import { ChatGLM } from './ChatGLM'; | ||
import { GoogleDeepMind } from './GoogleDeepMind'; | ||
import { Mistral } from './Mistral'; | ||
import { Tongyi } from './Tongyi'; | ||
|
||
interface ModelProviderIconProps { | ||
provider?: string; | ||
} | ||
|
||
const ModelProviderIcon = memo<ModelProviderIconProps>(({ provider }) => { | ||
switch (provider) { | ||
case ModelProvider.Anthropic: { | ||
return <Anthropic size={12} />; | ||
} | ||
case ModelProvider.Tongyi: { | ||
return <Tongyi size={12} />; | ||
} | ||
case ModelProvider.Mistral: { | ||
return <Mistral size={11} />; | ||
} | ||
case ModelProvider.Bedrock: { | ||
return <SiAmazonaws size={18} />; | ||
} | ||
|
||
case 'zhipu': | ||
case ModelProvider.ChatGLM: { | ||
return <ChatGLM size={18} />; | ||
} | ||
|
||
case ModelProvider.Google: { | ||
return <GoogleDeepMind size={12} />; | ||
} | ||
|
||
default: | ||
case ModelProvider.OpenAI: { | ||
return <SiOpenai size={12} />; | ||
} | ||
} | ||
}); | ||
|
||
export default ModelProviderIcon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,14 @@ | ||
import { SiAmazonaws, SiOpenai } from '@icons-pack/react-simple-icons'; | ||
import { Tag } from '@lobehub/ui'; | ||
import { memo, useMemo } from 'react'; | ||
import { memo } from 'react'; | ||
|
||
import { | ||
Anthropic, | ||
ChatGLM, | ||
GoogleDeepMind, | ||
Mistral, | ||
Tongyi, | ||
} from '@/components/ModelProviderIcons'; | ||
import { ModelProvider } from '@/libs/agent-runtime'; | ||
import ModelProviderIcon from '@/components/ModelProviderIcons'; | ||
|
||
interface ModelTagProps { | ||
name: string; | ||
provider?: ModelProvider; | ||
provider?: string; | ||
} | ||
const ModelTag = memo<ModelTagProps>(({ provider, name }) => { | ||
const icon = useMemo(() => { | ||
switch (provider) { | ||
case ModelProvider.Anthropic: { | ||
return <Anthropic size={12} />; | ||
} | ||
case ModelProvider.Tongyi: { | ||
return <Tongyi size={12} />; | ||
} | ||
case ModelProvider.Mistral: { | ||
return <Mistral size={11} />; | ||
} | ||
case ModelProvider.Bedrock: { | ||
return <SiAmazonaws size={18} />; | ||
} | ||
case ModelProvider.ChatGLM: { | ||
return <ChatGLM size={18} />; | ||
} | ||
case ModelProvider.Google: { | ||
return <GoogleDeepMind size={12} />; | ||
} | ||
|
||
default: | ||
case ModelProvider.OpenAI: { | ||
return <SiOpenai size={12} />; | ||
} | ||
} | ||
}, [provider]); | ||
|
||
return <Tag icon={icon}>{name}</Tag>; | ||
return <Tag icon={<ModelProviderIcon provider={provider} />}>{name}</Tag>; | ||
}); | ||
|
||
export default ModelTag; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.