|
|
|
@ -1,18 +1,13 @@ |
|
|
|
|
import React, { useContext, useEffect, useState, useCallback} from 'react' |
|
|
|
|
import React from 'react' |
|
|
|
|
import '../remix-ai.css' |
|
|
|
|
import { DefaultModels, GenerationParams, ChatHistory, HandleStreamResponse, HandleSimpleResponse } from '@remix/remix-ai-core'; |
|
|
|
|
import { ConversationStarter, StreamSend, StreamingAdapterObserver, useAiChatApi } from '@nlux/react'; |
|
|
|
|
import axios from 'axios'; |
|
|
|
|
import { AiChat, useAsStreamAdapter, ChatItem, AiChatUI} from '@nlux/react'; |
|
|
|
|
import { AiChat, useAsStreamAdapter, ChatItem } from '@nlux/react'; |
|
|
|
|
import { JsonStreamParser } from '@remix/remix-ai-core'; |
|
|
|
|
import { user, assistantAvatar } from './personas'; |
|
|
|
|
import { highlighter } from '@nlux/highlighter' |
|
|
|
|
import './color.css' |
|
|
|
|
import '@nlux/themes/unstyled.css'; |
|
|
|
|
// import '@nlux/themes'
|
|
|
|
|
import { result } from 'lodash'; |
|
|
|
|
|
|
|
|
|
const demoProxyServerUrl = 'https://solcoder.remixproject.org'; |
|
|
|
|
|
|
|
|
|
export let ChatApi = null |
|
|
|
|
|
|
|
|
@ -27,8 +22,7 @@ export const Default = (props) => { |
|
|
|
|
let response = null |
|
|
|
|
if (await props.plugin.call('remixAI', 'isChatRequestPending')){ |
|
|
|
|
response = await props.plugin.call('remixAI', 'ProcessChatRequestBuffer', GenerationParams); |
|
|
|
|
} |
|
|
|
|
else{ |
|
|
|
|
} else { |
|
|
|
|
response = await props.plugin.call('remixAI', 'solidity_answer', prompt, GenerationParams); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -70,7 +64,6 @@ export const Default = (props) => { |
|
|
|
|
avatar: assistantAvatar |
|
|
|
|
}, |
|
|
|
|
user |
|
|
|
|
|
|
|
|
|
}} |
|
|
|
|
//initialConversation={initialMessages}
|
|
|
|
|
conversationOptions={{ layout: 'bubbles', conversationStarters }} |
|
|
|
|