Skip to content

Commit

Permalink
Anthropic: server status. #485
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Apr 5, 2024
1 parent 78e3a57 commit b687f23
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 17 deletions.
20 changes: 4 additions & 16 deletions src/apps/news/news.data.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import * as React from 'react';
import { StaticImageData } from 'next/image';

import { SxProps } from '@mui/joy/styles/types';
import { Box, Chip, SvgIconProps, Typography } from '@mui/joy';
import AutoStoriesOutlinedIcon from '@mui/icons-material/AutoStoriesOutlined';
import GoogleIcon from '@mui/icons-material/Google';
import LaunchIcon from '@mui/icons-material/Launch';

import { AnthropicIcon } from '~/common/components/icons/vendors/AnthropicIcon';
import { ChatBeamIcon } from '~/common/components/icons/ChatBeamIcon';
import { ExternalLink } from '~/common/components/ExternalLink';
import { GroqIcon } from '~/common/components/icons/vendors/GroqIcon';
import { LocalAIIcon } from '~/common/components/icons/vendors/LocalAIIcon';
import { MistralIcon } from '~/common/components/icons/vendors/MistralIcon';
Expand Down Expand Up @@ -277,15 +275,6 @@ export const NewsItems: NewsItem[] = [
];


const wowStyle: SxProps = {
textDecoration: 'underline',
textDecorationThickness: '0.4em',
textDecorationColor: 'rgba(var(--joy-palette-primary-lightChannel) / 1)',
// textDecorationColor: 'rgba(0 255 0 / 0.5)',
textDecorationSkipInk: 'none',
// textUnderlineOffset: '-0.5em',
};

function B(props: {
// one-of
href?: string,
Expand All @@ -299,7 +288,6 @@ function B(props: {
props.issue ? `${Brand.URIs.OpenRepo}/issues/${props.issue}`
: props.code ? `${Brand.URIs.OpenRepo}/blob/main/${props.code}`
: props.href;
const isExtIcon = !props.issue;
const boldText = (
<Typography component='span' color={!!href ? 'primary' : 'neutral'} sx={{ fontWeight: 'lg' }}>
{props.children}
Expand All @@ -308,8 +296,8 @@ function B(props: {
if (!href)
return boldText;
return (
<Link href={href + clientUtmSource()} target='_blank' sx={props.wow ? wowStyle : undefined}>
{boldText} {isExtIcon ? <LaunchIcon sx={{ mx: 0.5, fontSize: 16 }} /> : <AutoStoriesOutlinedIcon sx={{ mx: 0.5, fontSize: 16 }} />}
</Link>
<ExternalLink href={href + clientUtmSource()} highlight={props.wow} icon={props.issue ? 'issue' : undefined}>
{boldText}
</ExternalLink>
);
}
35 changes: 35 additions & 0 deletions src/common/components/ExternalLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import * as React from 'react';

import { SxProps, TypographySystem } from '@mui/joy/styles/types';
import AutoStoriesOutlinedIcon from '@mui/icons-material/AutoStoriesOutlined';
import LaunchIcon from '@mui/icons-material/Launch';

import { Link } from './Link';


const wowStyle: SxProps = {
textDecoration: 'underline',
textDecorationThickness: '0.4em',
textDecorationColor: 'rgba(var(--joy-palette-primary-lightChannel) / 1)',
// textDecorationColor: 'rgba(0 255 0 / 0.5)',
textDecorationSkipInk: 'none',
// textUnderlineOffset: '-0.5em',
};


export function ExternalLink(props: {
href: string,
level?: keyof TypographySystem | 'inherit',
highlight?: boolean,
icon?: 'issue',
children: React.ReactNode,
}) {
return (
<Link level={props.level} href={props.href} target='_blank' sx={props.highlight ? wowStyle : undefined}>
{props.children} {props.icon === 'issue'
? <AutoStoriesOutlinedIcon sx={{ mx: 0.5, fontSize: 16 }} />
: <LaunchIcon sx={{ mx: 0.5, fontSize: 16 }} />
}
</Link>
);
}
3 changes: 2 additions & 1 deletion src/modules/llms/vendors/anthropic/AnthropicSourceSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from 'react';

import { Alert } from '@mui/joy';

import { ExternalLink } from '~/common/components/ExternalLink';
import { FormInputKey } from '~/common/components/forms/FormInputKey';
import { FormTextField } from '~/common/components/forms/FormTextField';
import { InlineError } from '~/common/components/InlineError';
Expand Down Expand Up @@ -40,7 +41,7 @@ export function AnthropicSourceSetup(props: { sourceId: DModelSourceId }) {

<Alert variant='soft' color='success'>
<div>
Note: <strong>Claude-3</strong> models are now supported.
Enjoy <b>Opus</b>, <b>Sonnet</b> and <b>Haiku</b>. Anthropic <ExternalLink level='body-sm' href='https://status.anthropic.com/'>server status</ExternalLink>.
</div>
</Alert>

Expand Down

0 comments on commit b687f23

Please sign in to comment.