Skip to content

Commit

Permalink
[ez] Rename aiconfig stream response to aiconfig_chunk response
Browse files Browse the repository at this point in the history
I was having some trouble converting everything to `STREAM_AICONFIG_CHUNK` so I'm just doing really easy steps to keep diffs easy to review and test. You'll be able to see final result at end of diff stack

## This diff
Just doing very simple name coy and replace, no functional changes
  • Loading branch information
Rossdan Craig [email protected] committed Jan 15, 2024
1 parent 00ef845 commit 0ac011d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions python/src/aiconfig/editor/client/src/LocalEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ export default function Editor() {
output_chunk: (data) => {
onStream({ type: "output_chunk", data: data as Output });
},
aiconfig: (data) => {
onStream({ type: "aiconfig", data: data as AIConfig });
aiconfig_chunk: (data) => {
onStream({ type: "aiconfig_chunk", data: data as AIConfig });
},
stop_streaming: (_data) => {
onStream({ type: "stop_streaming", data: null });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export type RunPromptStreamEvent =
data: Output;
}
| {
type: "aiconfig";
type: "aiconfig_chunk";
data: AIConfig;
}
| {
Expand Down Expand Up @@ -636,7 +636,7 @@ export default function EditorContainer({
id: promptId,
output: event.data,
});
} else if (event.type === "aiconfig") {
} else if (event.type === "aiconfig_chunk") {
// Next PR: Change this to aiconfig_stream to make it more obvious
// and make STREAM_AICONFIG it's own event so we don't need to pass
// the `isRunning` state to set. See Ryan's comments about this in
Expand Down
2 changes: 1 addition & 1 deletion python/src/aiconfig/editor/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ def kill_thread(thread_id: int | None):

aiconfig_json = aiconfig.model_dump(exclude=EXCLUDE_OPTIONS) if aiconfig is not None else None
yield "["
yield json.dumps({"aiconfig": aiconfig_json})
yield json.dumps({"aiconfig_chunk": aiconfig_json})
yield "]"

yield "["
Expand Down

0 comments on commit 0ac011d

Please sign in to comment.