forked from React-Group/interstellar_ai
		
	Compare commits
	
		
			No commits in common. "e50a5259ad66911753390a43ccb12f00d123416b" and "f9076c618c7666518ae90f678540dcebaf898ae6" have entirely different histories.
		
	
	
		
			e50a5259ad
			...
			f9076c618c
		
	
		
					 5 changed files with 11 additions and 76 deletions
				
			
		|  | @ -26,7 +26,7 @@ const handleCopyClick = () => { | ||||||
|   // Handle copy action
 |   // Handle copy action
 | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const InputBackend: React.FC = () => { | const InputBackend:React.FC = () => { | ||||||
|   async function prompt_mistral(model: string, prompt: string, system: string) { |   async function prompt_mistral(model: string, prompt: string, system: string) { | ||||||
|     const apiKey = "m3kZRjN8DRSIo88r8Iti9hmKGWIklrLY"; |     const apiKey = "m3kZRjN8DRSIo88r8Iti9hmKGWIklrLY"; | ||||||
|      |      | ||||||
|  | @ -40,6 +40,7 @@ const InputBackend: React.FC = () => { | ||||||
|     if (chatResponse && chatResponse.choices && chatResponse.choices.length > 0) { |     if (chatResponse && chatResponse.choices && chatResponse.choices.length > 0) { | ||||||
|       if (chatResponse.choices[0].message.content) { |       if (chatResponse.choices[0].message.content) { | ||||||
|         addMessage('AI: ' + chatResponse.choices[0].message.content); |         addMessage('AI: ' + chatResponse.choices[0].message.content); | ||||||
|  |         console.error('Error: Brain Not Found'); | ||||||
|         console.log(messages) |         console.log(messages) | ||||||
|       } |       } | ||||||
|     } else { |     } else { | ||||||
|  | @ -48,15 +49,9 @@ const InputBackend: React.FC = () => { | ||||||
|   } |   } | ||||||
|    |    | ||||||
|   const handleSendClick = (message: string) => { |   const handleSendClick = (message: string) => { | ||||||
|     var system = "You are a helpful assistant. The following is the chat history." |  | ||||||
|     for (let index = 0; index < messages.length; index++) { |  | ||||||
|       system += messages[index] + " "; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     addMessage('User: ' + message); |     addMessage('User: ' + message); | ||||||
|     prompt_mistral("mistral-large-latest", message, system) |     prompt_mistral("mistral-large-latest", message, "You are a helpful assistant.") | ||||||
|   }; |   }; | ||||||
| 
 |  | ||||||
|   const [messages, setMessages] = useState([ |   const [messages, setMessages] = useState([ | ||||||
|     'User: Hello!', |     'User: Hello!', | ||||||
|     'AI: Hi there!', |     'AI: Hi there!', | ||||||
|  |  | ||||||
|  | @ -10,7 +10,6 @@ header { | ||||||
|     box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); |     box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); | ||||||
|     z-index: 1000; |     z-index: 1000; | ||||||
|     font-family: var(--font-family); |     font-family: var(--font-family); | ||||||
|     height: 5vh; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| header li { | header li { | ||||||
|  |  | ||||||
|  | @ -5,9 +5,8 @@ | ||||||
|     overflow: hidden; |     overflow: hidden; | ||||||
|     background-color: var(--history-background-color); |     background-color: var(--history-background-color); | ||||||
|     padding: 1em; |     padding: 1em; | ||||||
|     margin: 1em; |  | ||||||
|     margin-right: 0; |  | ||||||
|     border-radius: 2em; |     border-radius: 2em; | ||||||
|  |     margin: 1em; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| .history { | .history { | ||||||
|  |  | ||||||
|  | @ -11,4 +11,3 @@ | ||||||
| @import './input.css'; | @import './input.css'; | ||||||
| @import './faq.css'; | @import './faq.css'; | ||||||
| @import './scrollbar.css'; | @import './scrollbar.css'; | ||||||
| @import './responsive.css'; |  | ||||||
|  |  | ||||||
|  | @ -1,57 +0,0 @@ | ||||||
| /* responsive.css */ |  | ||||||
| 
 |  | ||||||
| /* Responsive behavior - applies only on smaller screens */ |  | ||||||
| @media (max-width: 1200px) { |  | ||||||
| 
 |  | ||||||
|     /* Left panel as an overlay */ |  | ||||||
|     .left-panel { |  | ||||||
|         margin: 0 auto; |  | ||||||
|         min-width: 100vw; |  | ||||||
|         max-width: 100vw; |  | ||||||
|         padding: 1em; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     .left-panel.hidden { |  | ||||||
|         width: 0; |  | ||||||
|         /* Set width to 0 when hidden */ |  | ||||||
|         visibility: hidden; |  | ||||||
|         /* Fully hide the panel */ |  | ||||||
|         margin: 0; |  | ||||||
|         padding: 0; |  | ||||||
|         overflow: hidden; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     header { |  | ||||||
|         height: 125px; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     header li { |  | ||||||
|         flex-direction: column; |  | ||||||
|         display: block; |  | ||||||
|         padding: 2px; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     body { |  | ||||||
|         margin-top: 100px; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     .conversation-container.expanded { |  | ||||||
| 
 |  | ||||||
|         width: 0; |  | ||||||
|         /* Set width to 0 when hidden */ |  | ||||||
|         visibility: hidden; |  | ||||||
|         /* Fully hide the panel */ |  | ||||||
|         margin: 0; |  | ||||||
|         padding: 0; |  | ||||||
|         overflow: hidden; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     .conversation-container.collapsed { |  | ||||||
|         margin: 0 auto; |  | ||||||
|         min-width: 100vw; |  | ||||||
|         max-width: 100vw; |  | ||||||
|         padding: 1em; |  | ||||||
|         margin-left: 0; |  | ||||||
| 
 |  | ||||||
|     } |  | ||||||
| } |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue