Update api, Remove index.html
This commit is contained in:
parent
adec57e1b0
commit
6914f23313
18
index.html
18
index.html
@ -1,18 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Tour - Iced</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script type="module">
|
||||
import init from "./tour/tour.js";
|
||||
|
||||
init('./tour/tour_bg.wasm');
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
@ -5,8 +5,6 @@ use tokio_stream::wrappers::LinesStream;
|
||||
use tokio_stream::{Stream, StreamExt};
|
||||
use tokio_util::io::StreamReader;
|
||||
|
||||
const API_URL: &'static str = "http://localhost:11434";
|
||||
|
||||
pub struct OllamaAPI {
|
||||
api_url: &'static str,
|
||||
client: Client,
|
||||
@ -16,9 +14,10 @@ pub struct OllamaAPI {
|
||||
pub struct OllamaChat<'a> {
|
||||
#[serde(skip_serializing)]
|
||||
api: &'a OllamaAPI,
|
||||
model: String,
|
||||
#[serde(skip_serializing)]
|
||||
history_size: u32,
|
||||
|
||||
model: String,
|
||||
messages: Vec<ChatMessage>,
|
||||
}
|
||||
|
||||
@ -63,7 +62,7 @@ impl OllamaAPI {
|
||||
|
||||
let request = self
|
||||
.client
|
||||
.post(String::from(API_URL) + "/api/chat")
|
||||
.post(String::from(self.api_url) + "/api/chat")
|
||||
.body(serde_json::to_string(&chat)?)
|
||||
.build()?;
|
||||
let stream = self
|
||||
|
Loading…
Reference in New Issue
Block a user