i have this code
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Chat Prediction App</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f0f0f0;
            margin: 0;
            padding: 20px;
            line-height: 1.6;
        }
        .chat-container {
            max-width: 800px;
            margin: 0 auto;
            background-color: white;
            border-radius: 8px;
            overflow: hidden;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .message {
            padding: 15px;
            border-bottom: 1px solid #e0e0e0;
            display: flex;
            align-items: flex-start;
        }
        .message:last-child {
            border-bottom: none;
        }
        .user-icon {
            width: 30px;
            height: 30px;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            color: white;
            margin-right: 10px;
            flex-shrink: 0;
        }
        .user-icon.user {
            background-color: #1e7b85;
        }
        .user-icon.bot {
            background-color: #00a67e;
        }
        .message-content {
            flex-grow: 1;
        }
        .bot-message {
            background-color: #f9f9f9;
        }
        .feedback {
            float: right;
            color: #888;
        }
        .feedback span {
            cursor: pointer;
            margin-left: 10px;
        }
        .input-area {
            display: flex;
            padding: 10px 20px;
            background-color: #fff;
            border-top: 1px solid #ddd;
        }
        .input-area input {
            flex: 1;
            padding: 10px 15px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 16px;
            outline: none;
        }
        .input-area button {
            padding: 10px 20px;
            margin-left: 10px;
            background-color: #1e7b85;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            transition: background-color 0.3s;
        }
        .input-area button:hover {
            background-color: #165c63;
        }
    </style>
</head>
<body>
    <div class="chat-container">
        <div id="chat-window">
            <!-- Chat messages will be appended here -->
        </div>
        <form id="prediction-form" class="input-area">
            <input type="text" id="inputs" name="inputs" required placeholder="Type your message...">
            <button type="submit">Send</button>
        </form>
    </div>

    <script>
        const form = document.getElementById('prediction-form');
        const chatWindow = document.getElementById('chat-window');
        
        function appendMessage(content, isUser) {
            const messageDiv = document.createElement('div');
            messageDiv.classList.add('message');
            if (!isUser) messageDiv.classList.add('bot-message');
            
            const iconDiv = document.createElement('div');
            iconDiv.classList.add('user-icon', isUser ? 'user' : 'bot');
            iconDiv.textContent = isUser ? 'U' : 'AI';
        
            const contentDiv = document.createElement('div');
            contentDiv.classList.add('message-content');
            contentDiv.textContent = content;
        
            const feedbackDiv = document.createElement('div');
            feedbackDiv.classList.add('feedback');
            if (isUser) {
                feedbackDiv.innerHTML = '<span>🔗</span>';
            } else {
                feedbackDiv.innerHTML = '<span>👍</span><span>👎</span>';
            }
        
            messageDiv.appendChild(iconDiv);
            messageDiv.appendChild(contentDiv);
            messageDiv.appendChild(feedbackDiv);
            chatWindow.appendChild(messageDiv);
            chatWindow.scrollTop = chatWindow.scrollHeight;
        }
        
        form.addEventListener('submit', function(event) {
            event.preventDefault();
        
            const formData = new FormData(this);
            const inputs = formData.get('inputs');
        
            appendMessage(inputs, true);
        
            this.reset();
        
            fetch('/predict', {
                method: 'POST',
                body: new URLSearchParams({'inputs': inputs}),
                headers: {
                    'Content-Type': 'application/x-www-form-urlencoded'
                }
            })
            .then(response => response.json())
            .then(data => {
                if (data.error) {
                    appendMessage(`Error: ${data.error}`, false);
                } else {
                    // Handle the result without splitting
                    let botResponse = data.result;
                    if (Array.isArray(data.result) && data.result.length > 0) {
                        botResponse = data.result[0];
                    }
                    appendMessage(botResponse, false);
                }
            })
            .catch(error => {
                appendMessage(`Error: ${error}`, false);
            });
        });
        </script>
</body>
</html>

and this 
from flask import Flask, render_template, request, jsonify
from gradio_client import Client

app = Flask(__name__)

@app.route('/')
def home():
    return render_template('index.html')

@app.route('/predict', methods=['POST'])
def predict():
    inputs = request.form['inputs']

    # Initialize the Gradio client
    client = Client("yuntian-deng/o1")

    try:
        # Call the prediction API
        result = client.predict(
            inputs=inputs,
            top_p=1,
            temperature=1,
            chat_counter=0,
            chatbot=[],
            api_name="/predict"
        )
        # Parse the result to extract the bot's response
        result_parts = result[0].split(',')
        bot_response = result_parts[1] if len(result_parts) > 1 else 'No response available'
        return jsonify({'result': bot_response})
    except Exception as e:
        # Handle errors gracefully
        return jsonify({'error': str(e)}), 500

if __name__ == '__main__':
    app.run(debug=True)

and i get this error 
Error: 'list' object has no attribute 'split'

can you fix it please