-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #294 from l3vels/feat/run-logs
feat: start and end dates in run logs, add is chat history bool, add toolkit id
- Loading branch information
Showing
9 changed files
with
130 additions
and
59 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
70 changes: 70 additions & 0 deletions
70
apps/ui/src/modals/RunLogsModal/RunLogs/RunLogMessages/RunLogMessages.tsx
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,70 @@ | ||
import styled from 'styled-components' | ||
import { RunLog } from 'types' | ||
|
||
type RunLogMessagesProps = { | ||
log: RunLog | ||
} | ||
|
||
const RunLogMessages = ({ log }: RunLogMessagesProps) => { | ||
const { messages } = log | ||
|
||
return ( | ||
<StyledCards> | ||
{messages.map(({ name, content, is_chat_history }, index: number) => { | ||
// TODO: use is_chat_history to render chat history in collapse | ||
return ( | ||
<StyledCard key={index}> | ||
<StyledTitle>{name}</StyledTitle> | ||
|
||
{content && ( | ||
<StyledCodeCard> | ||
<StyledCodeContent>{content}</StyledCodeContent> | ||
</StyledCodeCard> | ||
)} | ||
</StyledCard> | ||
) | ||
})} | ||
</StyledCards> | ||
) | ||
} | ||
|
||
export default RunLogMessages | ||
|
||
const StyledCards = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: stretch; | ||
width: 100%; | ||
gap: 20px; | ||
` | ||
|
||
const StyledCard = styled.div` | ||
border-radius: 10px; | ||
padding: 20px; | ||
width: 100%; | ||
background: #fff; | ||
color: #000; | ||
` | ||
|
||
const StyledTitle = styled.h2` | ||
margin: 0; | ||
padding: 0; | ||
font-size: 18px; | ||
color: #000; | ||
` | ||
|
||
const StyledCodeCard = styled.div` | ||
margin-top: 15px; | ||
padding: 16px; | ||
background-color: #f1f1f1; | ||
border-radius: 10px; | ||
` | ||
|
||
const StyledCodeContent = styled.pre` | ||
margin: 0; | ||
padding: 0; | ||
font-family: monospace; | ||
white-space: pre-wrap; | ||
font-size: 12px; | ||
color: #000; | ||
` |
1 change: 1 addition & 0 deletions
1
apps/ui/src/modals/RunLogsModal/RunLogs/RunLogMessages/index.tsx
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 @@ | ||
export { default } from './RunLogMessages' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
import { Nullable } from './utils' | ||
|
||
export interface RunLog { | ||
id: string | ||
name: string | ||
type: 'LLM' | 'Tool' | ||
messages: { | ||
name: string | ||
content: string | ||
is_chat_history: Nullable<boolean> | ||
}[] | ||
created_on: string | ||
start_date: Nullable<string> | ||
end_date: Nullable<string> | ||
toolkit_id: Nullable<string> | ||
} |