Skip to content

Commit

Permalink
feat: add ChatContext to AssistantMessageSection component
Browse files Browse the repository at this point in the history
  • Loading branch information
Sma1lboy committed Nov 19, 2024
1 parent 6f935f8 commit b40ea3c
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import {
} from '@/components/message-markdown'

import { ConversationMessage, SearchContext, SOURCE_CARD_STYLE } from './search'
import { ChatContext } from '@/components/chat/chat'

export function AssistantMessageSection({
message,
Expand Down Expand Up @@ -91,6 +92,8 @@ export function AssistantMessageSection({
onUpdateMessage
} = useContext(SearchContext)

const {serverCapabilities}= useContext(ChatContext)

const [isEditing, setIsEditing] = useState(false)
const [showMoreSource, setShowMoreSource] = useState(false)
const [relevantCodeHighlightIndex, setRelevantCodeHighlightIndex] = useState<
Expand Down Expand Up @@ -325,6 +328,7 @@ export function AssistantMessageSection({
contextInfo={contextInfo}
fetchingContextInfo={fetchingContextInfo}
canWrapLongLines={!isLoading}
serverCapabilities={serverCapabilities}
/>
{/* if isEditing, do not display error message block */}
{message.error && <ErrorMessageBlock error={message.error} />}
Expand Down

0 comments on commit b40ea3c

Please sign in to comment.