-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added new trace types for Response step (PL3-54) #446
Open
zhihil
wants to merge
8
commits into
master
Choose a base branch
from
brennan/response-trace-types/PL3-54
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+155
−1
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2809134
feat: added json and video trace types
zhihil 235b5c8
feat: update yarn.lock
zhihil f44d8d3
feat: exporting trace types and amending json type
zhihil f7461ce
fix: lockfile issue
zhihil 5681eaf
feat: adding image trace
zhihil dff84b1
refactor: exporting distinct traces
zhihil 76c854e
refactor: converting trace types into v3 traces and adding markup type
zhihil 0baae44
refactor: adding v3 trace types
zhihil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export type MarkupNode = string | { attributes: Record<string, unknown>; text: Markup }; | ||
|
||
export type Markup = Array<MarkupNode>; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { BaseTraceFrame, TraceType } from '../../node/utils'; | ||
|
||
/** | ||
* The logging level of the debug trace. This property can be used to | ||
* filter for particular debug messages | ||
* | ||
* Definition of error levels is based on this article: https://sematext.com/blog/logging-levels/ | ||
*/ | ||
export enum DebugInfoLevel { | ||
/** | ||
* Used for finely detailed information to gain full visibility into the | ||
* `general-runtime` and debug a Voiceflow porgram. | ||
* | ||
* Messages of this nature can be extremely verbose, e.g, may annotate each | ||
* step of an algorithm. | ||
*/ | ||
Trace = 'trace', | ||
|
||
/** | ||
* Less granular, but still detailed information compared to `Trace`. | ||
* Used for troubleshooting and diagnosing issues or running an application | ||
* in a dev environment. | ||
*/ | ||
Debug = 'debug', | ||
|
||
/** | ||
* Standard log level indicating an event occurred in the `general-runtime`. | ||
* | ||
* Should not contain important debugging information, as this setting should not | ||
* be enabled on a regular basis. | ||
*/ | ||
Info = 'info', | ||
|
||
/** | ||
* Indicates an unexpected event that does NOT impede code execution. This | ||
* may not necessarily be an error. | ||
*/ | ||
Warn = 'warn', | ||
|
||
/** | ||
* Indicates an error that impedes code execution and causes non-business-logic | ||
* to break, e.g, payment API call did not go through. | ||
*/ | ||
Error = 'error', | ||
|
||
/** | ||
* Indicates a critical error that impedes critical business functionality, e.g, | ||
* could not start the Voiceflow program because it was not compiled. | ||
*/ | ||
Fatal = 'fatal', | ||
} | ||
|
||
/** | ||
* Indicates the concern or component that spawned this particular debug message. | ||
*/ | ||
export enum DebugCode { | ||
/** | ||
* Debug information that is not pinned down to any particular component. | ||
*/ | ||
General = 'general', | ||
|
||
/** | ||
* Debug information arises from the knowledge base. | ||
*/ | ||
KnowledgeBase = 'knowledge_base', | ||
} | ||
|
||
interface StepData { | ||
code: DebugCode; | ||
level: DebugInfoLevel; | ||
details: Record<string, any>; | ||
} | ||
|
||
export interface TraceFrame extends BaseTraceFrame<StepData> { | ||
type: TraceType.V3_DEBUG; | ||
} |
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,9 @@ | ||
import { BaseTraceFrame, TraceType } from '../../node/utils'; | ||
|
||
interface StepData { | ||
url: string; | ||
} | ||
|
||
export interface TraceFrame extends BaseTraceFrame<StepData> { | ||
type: TraceType.V3_IMAGE; | ||
} |
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,10 @@ | ||
export { TraceFrame as DebugTrace } from './debug'; | ||
export * as Debug from './debug'; | ||
export { TraceFrame as ImageTrace } from './image'; | ||
export * as Image from './image'; | ||
export { TraceFrame as JSONTrace } from './json'; | ||
export * as JSON from './json'; | ||
export { TraceFrame as TextTrace } from './text'; | ||
export * as Text from './text'; | ||
export { TraceFrame as VideoTrace } from './video'; | ||
export * as Video from './video'; |
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,9 @@ | ||
import { BaseTraceFrame, TraceType } from '../../node/utils'; | ||
|
||
interface StepData { | ||
json: unknown; | ||
} | ||
|
||
export interface TraceFrame extends BaseTraceFrame<StepData> { | ||
type: TraceType.V3_JSON; | ||
} |
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,11 @@ | ||
import { Markup } from '@base-types/markup'; | ||
|
||
import { BaseTraceFrame, TraceType } from '../../node/utils'; | ||
|
||
interface StepData { | ||
content: Markup; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The data payload is subject to change due to a proposal by Tyler H to simply return Markdown rather than Markup. See slack thread here. |
||
} | ||
|
||
export interface TraceFrame extends BaseTraceFrame<StepData> { | ||
type: TraceType.V3_TEXT; | ||
} |
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,9 @@ | ||
import { BaseTraceFrame, TraceType } from '../../node/utils'; | ||
|
||
interface StepData { | ||
url: string; | ||
} | ||
|
||
export interface TraceFrame extends BaseTraceFrame<StepData> { | ||
type: TraceType.V3_VIDEO; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the idea to move this out of the
text
trace'spayload
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct. The new JSON variant seems to also have a sort of delay property, based on the Figma mocks.