icon is working
This commit is contained in:
parent
8792a02717
commit
efb30368a1
@ -692,14 +692,8 @@ class WebServer:
|
|||||||
def setup_routes(self):
|
def setup_routes(self):
|
||||||
"""Setup Flask routes"""
|
"""Setup Flask routes"""
|
||||||
|
|
||||||
@self.app.route('/')
|
|
||||||
def serve():
|
|
||||||
return send_from_directory(self.app.static_folder, 'index.html')
|
|
||||||
def index():
|
|
||||||
return render_template('index.html')
|
|
||||||
|
|
||||||
# Basic endpoint for chat completions
|
# Basic endpoint for chat completions
|
||||||
@self.app.route('/chat', methods=['POST'])
|
@self.app.route('/api/chat', methods=['POST'])
|
||||||
async def chat():
|
async def chat():
|
||||||
if not irc_bot:
|
if not irc_bot:
|
||||||
return jsonify({ "error": "Bot not initialized" }), 400
|
return jsonify({ "error": "Bot not initialized" }), 400
|
||||||
@ -715,29 +709,38 @@ class WebServer:
|
|||||||
}), 400
|
}), 400
|
||||||
|
|
||||||
# Context requests
|
# Context requests
|
||||||
@self.app.route('/history', methods=['GET'])
|
@self.app.route('/api/history', methods=['GET'])
|
||||||
def http_history():
|
def http_history():
|
||||||
if not irc_bot:
|
if not irc_bot:
|
||||||
return jsonify({ "error": "Bot not initialized" }), 400
|
return jsonify({ "error": "Bot not initialized" }), 400
|
||||||
return jsonify(irc_bot.history), 200
|
return jsonify(irc_bot.history), 200
|
||||||
|
|
||||||
@self.app.route('/system', methods=['GET'])
|
@self.app.route('/api/system', methods=['GET'])
|
||||||
def http_system():
|
def http_system():
|
||||||
if not irc_bot:
|
if not irc_bot:
|
||||||
return jsonify({ "error": "Bot not initialized" }), 400
|
return jsonify({ "error": "Bot not initialized" }), 400
|
||||||
return jsonify(system_log), 200
|
return jsonify(system_log), 200
|
||||||
|
|
||||||
@self.app.route('/tools', methods=['GET'])
|
@self.app.route('/api/tools', methods=['GET'])
|
||||||
def http_tools():
|
def http_tools():
|
||||||
if not irc_bot:
|
if not irc_bot:
|
||||||
return jsonify({ "error": "Bot not initialized" }), 400
|
return jsonify({ "error": "Bot not initialized" }), 400
|
||||||
return jsonify(tool_log), 200
|
return jsonify(tool_log), 200
|
||||||
|
|
||||||
# Health check endpoint
|
# Health check endpoint
|
||||||
@self.app.route('/health', methods=['GET'])
|
@self.app.route('/api/health', methods=['GET'])
|
||||||
def health():
|
def health():
|
||||||
return jsonify({"status": "healthy"}), 200
|
return jsonify({"status": "healthy"}), 200
|
||||||
|
|
||||||
|
# Serve React app - This catches all routes not matched by API endpoints
|
||||||
|
@self.app.route('/', defaults={'path': ''})
|
||||||
|
@self.app.route('/<path:path>')
|
||||||
|
def serve(path):
|
||||||
|
if path != "" and os.path.exists(self.app.static_folder + '/' + path):
|
||||||
|
return send_from_directory(self.app.static_folder, path)
|
||||||
|
else:
|
||||||
|
return send_from_directory(self.app.static_folder, 'index.html')
|
||||||
|
|
||||||
def run(self, host='0.0.0.0', port=5000, debug=False, **kwargs):
|
def run(self, host='0.0.0.0', port=5000, debug=False, **kwargs):
|
||||||
"""Run the web server"""
|
"""Run the web server"""
|
||||||
# Load documents
|
# Load documents
|
||||||
|
@ -4,13 +4,14 @@ export default function AboutScreen() {
|
|||||||
return (
|
return (
|
||||||
<View style={styles.container}>
|
<View style={styles.container}>
|
||||||
<Text style={styles.text}>
|
<Text style={styles.text}>
|
||||||
<div>Welcome to my AI agent. It has live access to websites, weather, and stock information. You can ask it things like:
|
<div>Welcome to Ketr-AI. This AI agent has live access to websites, weather, and stock information. You can ask it things like:
|
||||||
<ul>
|
<ul>
|
||||||
<li>What's the current weather?</li>
|
<li>What's the current weather in Kansas?</li>
|
||||||
<li>Can you provide the current headlines from http://cnn.com?</li>
|
<li>Can you provide the current headlines from http://cnn.com?</li>
|
||||||
<li>What is the current value of the 5 most traded companies?</li>
|
<li>What is the current value of the 5 most traded companies?</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<div>Internally, the system is using the LLAMA3.2 large language model, currently running locally in ollama. Various tools have been enabled for the LLM to use.</div>
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
@ -28,7 +28,7 @@ const App = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchHistory = async () => {
|
const fetchHistory = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${url}/history`);
|
const response = await fetch(`${url}/api/history`);
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
if (conversation.length != data.length)
|
if (conversation.length != data.length)
|
||||||
setConversation(data || []);
|
setConversation(data || []);
|
||||||
@ -69,7 +69,7 @@ const App = () => {
|
|||||||
try {
|
try {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
// Send query to server
|
// Send query to server
|
||||||
const response = await fetch(`${url}/chat`, {
|
const response = await fetch(`${url}/api/chat`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
@ -1,10 +1,18 @@
|
|||||||
import { Stack } from 'expo-router';
|
import { Stack } from 'expo-router';
|
||||||
|
import { Helmet } from 'react-helmet';
|
||||||
|
|
||||||
export default function RootLayout() {
|
export default function RootLayout() {
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
<Helmet>
|
||||||
|
<title>Ketr-AI for Everyone</title>
|
||||||
|
<meta name="description" content="Ketr-AI for Everyone" />
|
||||||
|
<link rel="icon" href="/favicon.ico" />
|
||||||
|
</Helmet>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
||||||
<Stack.Screen name="+not-found" />
|
<Stack.Screen name="+not-found" />
|
||||||
</Stack>
|
</Stack>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
BIN
src/client/assets/favicon.ico
Executable file
BIN
src/client/assets/favicon.ico
Executable file
Binary file not shown.
After Width: | Height: | Size: 318 B |
BIN
src/client/assets/images/favicon.ico
Executable file
BIN
src/client/assets/images/favicon.ico
Executable file
Binary file not shown.
After Width: | Height: | Size: 318 B |
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 4.6 KiB |
23
src/client/package-lock.json
generated
23
src/client/package-lock.json
generated
@ -26,6 +26,7 @@
|
|||||||
"react": "18.3.1",
|
"react": "18.3.1",
|
||||||
"react-dom": "18.3.1",
|
"react-dom": "18.3.1",
|
||||||
"react-fontawesome": "^1.7.1",
|
"react-fontawesome": "^1.7.1",
|
||||||
|
"react-helmet": "^6.1.0",
|
||||||
"react-native": "0.76.7",
|
"react-native": "0.76.7",
|
||||||
"react-native-gesture-handler": "~2.20.2",
|
"react-native-gesture-handler": "~2.20.2",
|
||||||
"react-native-markdown-display": "^7.0.2",
|
"react-native-markdown-display": "^7.0.2",
|
||||||
@ -11169,6 +11170,20 @@
|
|||||||
"react": ">=17.0.0"
|
"react": ">=17.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/react-helmet": {
|
||||||
|
"version": "6.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-6.1.0.tgz",
|
||||||
|
"integrity": "sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==",
|
||||||
|
"dependencies": {
|
||||||
|
"object-assign": "^4.1.1",
|
||||||
|
"prop-types": "^15.7.2",
|
||||||
|
"react-fast-compare": "^3.1.1",
|
||||||
|
"react-side-effect": "^2.1.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": ">=16.3.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/react-helmet-async": {
|
"node_modules/react-helmet-async": {
|
||||||
"version": "1.3.0",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-helmet-async/-/react-helmet-async-1.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-helmet-async/-/react-helmet-async-1.3.0.tgz",
|
||||||
@ -11494,6 +11509,14 @@
|
|||||||
"react": "^16.0.0 || ^17.0.0 || ^18.0.0"
|
"react": "^16.0.0 || ^17.0.0 || ^18.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/react-side-effect": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-PVjOcvVOyIILrYoyGEpDN3vmYNLdy1CajSFNt4TDsVQC5KpTijDvWVoR+/7Rz2xT978D8/ZtFceXxzsPwZEDvw==",
|
||||||
|
"peerDependencies": {
|
||||||
|
"react": "^16.3.0 || ^17.0.0 || ^18.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/react-spinners": {
|
"node_modules/react-spinners": {
|
||||||
"version": "0.15.0",
|
"version": "0.15.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-spinners/-/react-spinners-0.15.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-spinners/-/react-spinners-0.15.0.tgz",
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
"react": "18.3.1",
|
"react": "18.3.1",
|
||||||
"react-dom": "18.3.1",
|
"react-dom": "18.3.1",
|
||||||
"react-fontawesome": "^1.7.1",
|
"react-fontawesome": "^1.7.1",
|
||||||
|
"react-helmet": "^6.1.0",
|
||||||
"react-native": "0.76.7",
|
"react-native": "0.76.7",
|
||||||
"react-native-gesture-handler": "~2.20.2",
|
"react-native-gesture-handler": "~2.20.2",
|
||||||
"react-native-markdown-display": "^7.0.2",
|
"react-native-markdown-display": "^7.0.2",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user