-
Notifications
You must be signed in to change notification settings - Fork 348
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(prompts): Display basic LLM details on Prompt Details pages (#6104)
* feat(prompts): Display basic LLM details on Prompt Details pages * Remove extraneous export
- Loading branch information
1 parent
5b26835
commit 07f548f
Showing
6 changed files
with
162 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import React, { PropsWithChildren } from "react"; | ||
import { graphql, useFragment } from "react-relay"; | ||
|
||
import { List, ListItem } from "@arizeai/components"; | ||
|
||
import { | ||
Disclosure, | ||
DisclosurePanel, | ||
DisclosureTrigger, | ||
Flex, | ||
Text, | ||
View, | ||
} from "@phoenix/components"; | ||
import { ModelProviders } from "@phoenix/constants/generativeConstants"; | ||
import { PromptLLM__main$key } from "@phoenix/pages/prompt/__generated__/PromptLLM__main.graphql"; | ||
|
||
const ModelProviderItem = ({ | ||
keyName, | ||
children, | ||
}: PropsWithChildren<{ | ||
keyName: string; | ||
}>) => ( | ||
<ListItem listSize="small"> | ||
<View paddingStart="size-100" paddingEnd="size-100"> | ||
<Flex direction="row" justifyContent="space-between"> | ||
<Text size="XS" color="text-700"> | ||
{keyName} | ||
</Text> | ||
<Text size="XS">{children}</Text> | ||
</Flex> | ||
</View> | ||
</ListItem> | ||
); | ||
|
||
type PromptLLMProps = { | ||
promptVersion: PromptLLM__main$key; | ||
}; | ||
|
||
export function PromptLLM({ promptVersion }: PromptLLMProps) { | ||
const data = useFragment<PromptLLM__main$key>( | ||
graphql` | ||
fragment PromptLLM__main on PromptVersion { | ||
model: modelName | ||
provider: modelProvider | ||
} | ||
`, | ||
promptVersion | ||
); | ||
return ( | ||
<Disclosure id="llm"> | ||
<DisclosureTrigger>LLM</DisclosureTrigger> | ||
<DisclosurePanel> | ||
<List listSize="small"> | ||
<ModelProviderItem keyName="Model">{data.model}</ModelProviderItem> | ||
<ModelProviderItem keyName="Provider"> | ||
{ModelProviders[data.provider as ModelProvider] ?? data.provider} | ||
</ModelProviderItem> | ||
</List> | ||
</DisclosurePanel> | ||
</Disclosure> | ||
); | ||
} |
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
50 changes: 50 additions & 0 deletions
50
app/src/pages/prompt/__generated__/PromptLLM__main.graphql.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
27 changes: 24 additions & 3 deletions
27
app/src/pages/prompt/__generated__/PromptModelConfigurationCard__main.graphql.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
13 changes: 10 additions & 3 deletions
13
app/src/pages/prompt/__generated__/promptLoaderQuery.graphql.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.