Skip to content

Commit

Permalink
remove "pending" field on backend
Browse files Browse the repository at this point in the history
  • Loading branch information
madeindjs committed Nov 15, 2024
1 parent 7b9e23e commit cc6a7fd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<CoreChatbotMessageContentThoughtProcess
v-else-if="message.role === 'thought_process'"
:content="message.content"
:pending="message.pending"
:pending="pending"
/>
<div v-else class="CoreChatbotMessage__content__text">
<BaseMarkdown v-if="useMarkdown" :raw-text="content">
Expand Down Expand Up @@ -55,7 +55,6 @@ type NestedStringArray = ValueOrArray<string>;
export type Message = {
role: string;
pending: boolean;
content?: NestedStringArray;
actions?: Action[];
};
Expand Down Expand Up @@ -86,6 +85,7 @@ const props = defineProps({
},
assistantRoleColor: { type: String, required: false, default: "" },
isLoading: { type: Boolean, required: false },
pending: { type: Boolean },
});
defineEmits({
Expand All @@ -110,7 +110,7 @@ const isThoughtProcess = computed(
const displayInitials = computed(() => {
if (!isThoughtProcess.value) return true;
return !!props.message?.pending;
return !!props.pending;
});
const content = computed(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ const props = defineProps({
type: [String, Array] as PropType<Message["content"]>,
required: true,
},
pending: {
type: Boolean,
},
pending: { type: Boolean },
});
const isExpanded = ref(false);
Expand Down
4 changes: 4 additions & 0 deletions src/ui/src/components/core/content/CoreChatbot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ See the stubs for more details.
:message="message"
:use-markdown="fields.useMarkdown.value == 'yes'"
:assistant-role-color="fields.assistantRoleColor.value"
:pending="
message.role === 'thought_process' &&
messageId + 1 === messages.length
"
:initials="
message.role === 'assistant'
? fields.assistantInitials.value
Expand Down
3 changes: 0 additions & 3 deletions src/writer/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,6 @@ class Message(TypedDict, total=False):
name: Optional[str]
tool_call_id: Optional[str]
tool_calls: Optional[List[Dict[str, Union[int, Dict]]]]
pending: Optional[bool]

@classmethod
def validate_message(cls, message):
Expand Down Expand Up @@ -1316,7 +1315,6 @@ def __add__(self, chunk_or_message: Union['Conversation.Message', dict]):
"role": message["role"],
"content": message["content"],
"actions": message.get("actions"),
"pending": message.get("pending")
}
if "tool_calls" in message:
message_to_append["tool_calls"] = message["tool_calls"]
Expand Down Expand Up @@ -1839,7 +1837,6 @@ def _serialize_message(self, message: 'Conversation.Message'):
"role": message["role"],
"content": message["content"],
"actions": message["actions"],
"pending": message.get("pending"),
}

@property
Expand Down

0 comments on commit cc6a7fd

Please sign in to comment.