mirror of https://github.com/kortix-ai/suna.git
func name & xml_tag_name
This commit is contained in:
parent
c1d7c82f82
commit
cec49e2cd6
|
@ -30,7 +30,7 @@ async def run_agent(thread_id: str, stream: bool = True, thread_manager: Optiona
|
|||
"content": get_system_prompt()
|
||||
}
|
||||
|
||||
model_name = "anthropic/claude-3-5-sonnet-latest" #groq/deepseek-r1-distill-llama-70b
|
||||
model_name = "groq/deepseek-r1-distill-llama-70b" #anthropic/claude-3-5-sonnet-latest
|
||||
|
||||
files_tool = FilesTool()
|
||||
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>About - Workspace</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<!-- Include navigation.html content here -->
|
||||
</nav>
|
||||
|
||||
<section class="hero">
|
||||
<div class="container">
|
||||
<h1>About Us</h1>
|
||||
<p>Creating spaces that inspire productivity and creativity</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<img src="https://images.unsplash.com/photo-1584622650111-993a426fbf0a?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80" alt="About Us" class="img-fluid">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h2 class="section-title">Our Story</h2>
|
||||
<p class="lead">We believe that everyone deserves a great place to work. Workspace connects people with unique, inspiring spaces that enhance productivity and creativity.</p>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Our Team</h3>
|
||||
<p class="card-text">Meet the people behind Workspace</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Our Mission</h3>
|
||||
<p class="card-text">To revolutionize the way people work and interact</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,68 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Become a Host - Workspace</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<!-- Include navigation.html content here -->
|
||||
</nav>
|
||||
|
||||
<section class="hero">
|
||||
<div class="container">
|
||||
<h1>Become a Host</h1>
|
||||
<p>Earn extra income by sharing your space</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">List Your Space</h2>
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Title</label>
|
||||
<input type="text" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Description</label>
|
||||
<textarea class="form-control" rows="3" required></textarea>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Location</label>
|
||||
<input type="text" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Price per day</label>
|
||||
<input type="number" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Amenities</label>
|
||||
<select class="form-select" multiple>
|
||||
<option>WiFi</option>
|
||||
<option>Parking</option>
|
||||
<option>Kitchen</option>
|
||||
<option>Restrooms</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-dark">Submit</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,63 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Browse Spaces - Workspace</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<!-- Include navigation.html content here -->
|
||||
</nav>
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4 mb-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">Filter Spaces</h4>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Location</label>
|
||||
<input type="text" class="form-control" placeholder="Enter city or neighborhood">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Capacity</label>
|
||||
<select class="form-select">
|
||||
<option>1-5 people</option>
|
||||
<option>6-10 people</option>
|
||||
<option>11-20 people</option>
|
||||
<option>21+ people</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Amenities</label>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="wifi">
|
||||
<label class="form-check-label" for="wifi">WiFi</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="parking">
|
||||
<label class="form-check-label" for="parking">Parking</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<!-- Space cards will go here -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,66 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Contact - Workspace</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<!-- Include navigation.html content here -->
|
||||
</nav>
|
||||
|
||||
<section class="hero">
|
||||
<div class="container">
|
||||
<h1>Contact Us</h1>
|
||||
<p>We'd love to hear from you</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">Get in Touch</h2>
|
||||
<form>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Name</label>
|
||||
<input type="text" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Email</label>
|
||||
<input type="email" class="form-control" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Message</label>
|
||||
<textarea class="form-control" rows="4" required></textarea>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-dark">Send Message</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Contact Information</h3>
|
||||
<p class="card-text">123 Workspace Street</p>
|
||||
<p class="card-text">New York, NY 10001</p>
|
||||
<p class="card-text">Phone: (555) 123-4567</p>
|
||||
<p class="card-text">Email: info@workspace.com</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,44 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Dashboard - Workspace</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<!-- Include navigation.html content here -->
|
||||
</nav>
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Welcome, [User]</h3>
|
||||
<p class="card-text">Your Dashboard</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Your Bookings</h3>
|
||||
<div class="list-group">
|
||||
<!-- Booking items will go here -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,60 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>FAQ - Workspace</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<!-- Include navigation.html content here -->
|
||||
</nav>
|
||||
|
||||
<section class="hero">
|
||||
<div class="container">
|
||||
<h1>Frequently Asked Questions</h1>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<input type="text" class="form-control" placeholder="Search FAQ...">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">How do I book a space?</h3>
|
||||
<p class="card-text">Search for spaces, select a location, and complete the booking form.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">What is the cancellation policy?</h3>
|
||||
<p class="card-text">Most spaces have a 24-hour cancellation policy. Check the space details for specific policies.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Add more FAQ cards as needed -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -3,52 +3,233 @@
|
|||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>AGI Interface</title>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
|
||||
<title>Workspace - Find Your Perfect Office Space</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
|
||||
<style>
|
||||
:root {
|
||||
--primary-color: #000;
|
||||
--secondary-color: #444;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
font-family: 'Arial', sans-serif;
|
||||
}
|
||||
|
||||
nav {
|
||||
background: white;
|
||||
padding: 15px 0;
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
}
|
||||
|
||||
.navbar-brand {
|
||||
font-weight: 700;
|
||||
font-size: 24px;
|
||||
color: var(--primary-color) !important;
|
||||
}
|
||||
|
||||
.hero {
|
||||
height: 80vh;
|
||||
background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1584622650111-993a426fbf0a?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: white;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
font-size: 48px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.hero p {
|
||||
font-size: 20px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.cta-button {
|
||||
padding: 15px 30px;
|
||||
background: #fff;
|
||||
color: var(--primary-color);
|
||||
border: none;
|
||||
border-radius: 25px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
transition: background 0.3s;
|
||||
}
|
||||
|
||||
.cta-button:hover {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
.section {
|
||||
padding: 80px 0;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
text-align: center;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.card {
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
.card img {
|
||||
height: 250px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-weight: 600;
|
||||
margin: 15px 0;
|
||||
}
|
||||
|
||||
.card-text {
|
||||
color: var(--secondary-color);
|
||||
}
|
||||
|
||||
.card-button {
|
||||
padding: 10px 20px;
|
||||
background: var(--primary-color);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
footer {
|
||||
background: var(--primary-color);
|
||||
color: white;
|
||||
padding: 50px 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<header>
|
||||
<h1>AGI Interface</h1>
|
||||
<div class="status-indicator">
|
||||
<span class="pulse"></span>
|
||||
<span>System Active</span>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="#">Workspace</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Browse</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Become a Host</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
<section class="interaction-panel">
|
||||
<div class="chat-interface">
|
||||
<div id="chat-messages" class="messages"></div>
|
||||
<div class="input-area">
|
||||
<input type="text" id="user-input" placeholder="Enter your query...">
|
||||
<button id="send-btn"><i class="fas fa-paper-plane"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section class="hero">
|
||||
<div class="container">
|
||||
<h1>Find Your Perfect Workspace</h1>
|
||||
<p>Book beautiful spaces that inspire your best work</p>
|
||||
<button class="cta-button">Explore Now</button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="visualization-panel">
|
||||
<div class="neural-network">
|
||||
<canvas id="neural-canvas"></canvas>
|
||||
</div>
|
||||
<div class="metrics">
|
||||
<div class="metric">
|
||||
<h3>Processing Power</h3>
|
||||
<div class="progress-bar">
|
||||
<div class="progress" id="processing-power"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="metric">
|
||||
<h3>Learning Rate</h3>
|
||||
<div class="progress-bar">
|
||||
<div class="progress" id="learning-rate"></div>
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h2 class="section-title">How It Works</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<i class="fas fa-search fa-3x"></i>
|
||||
<h3 class="card-title">Search</h3>
|
||||
<p class="card-text">Find the perfect space for your needs</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
<script src="script.js"></script>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<i class="fas fa-building fa-3x"></i>
|
||||
<h3 class="card-title">Visit</h3>
|
||||
<p class="card-text">Tour spaces that fit your requirements</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<i class="fas fa-key fa-3x"></i>
|
||||
<h3 class="card-title">Move In</h3>
|
||||
<p class="card-text">Sign and start working immediately</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h2 class="section-title">Featured Spaces</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<img src="https://images.unsplash.com/photo-1584622650111-993a426fbf0a?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80" alt="Office Space">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Modern Downtown Office</h3>
|
||||
<p class="card-text">New York, NY</p>
|
||||
<button class="card-button">Book Now</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Add more space cards as needed -->
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
<div class="container text-center">
|
||||
<p>© 2023 Workspace. All rights reserved.</p>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script>
|
||||
// Add smooth scrolling
|
||||
$(document).ready(function(){
|
||||
$('a[href^="#"]').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
var target = $(this.getAttribute('href'));
|
||||
if( target.length ) {
|
||||
$('html, body').stop().animate({
|
||||
scrollTop: target.offset().top
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
|
||||
// Add parallax effect to hero image
|
||||
$(window).scroll(function(){
|
||||
var scrolled = $(window).scrollTop();
|
||||
$('.hero').css('background-position-y', -(scrolled * 0.5));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,35 @@
|
|||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="index.html">Workspace</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="browse-spaces.html">Browse Spaces</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="become-a-host.html">Become a Host</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="about.html">About</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="contact.html">Contact</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="faq.html">FAQ</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item">
|
||||
<a class="btn btn-outline-dark" href="signin.html">Sign In</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="btn btn-dark" href="signup.html">Sign Up</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
|
@ -1,140 +1,18 @@
|
|||
class AGIInterface {
|
||||
constructor() {
|
||||
this.initializeElements();
|
||||
this.bindEvents();
|
||||
this.initializeNeuralNetwork();
|
||||
this.updateMetrics();
|
||||
}
|
||||
|
||||
initializeElements() {
|
||||
this.chatMessages = document.getElementById('chat-messages');
|
||||
this.userInput = document.getElementById('user-input');
|
||||
this.sendButton = document.getElementById('send-btn');
|
||||
this.canvas = document.getElementById('neural-canvas');
|
||||
this.ctx = this.canvas.getContext('2d');
|
||||
this.processingPower = document.getElementById('processing-power');
|
||||
this.learningRate = document.getElementById('learning-rate');
|
||||
}
|
||||
|
||||
bindEvents() {
|
||||
this.sendButton.addEventListener('click', () => this.handleUserInput());
|
||||
this.userInput.addEventListener('keypress', (e) => {
|
||||
if (e.key === 'Enter') this.handleUserInput();
|
||||
});
|
||||
window.addEventListener('resize', () => this.resizeCanvas());
|
||||
}
|
||||
|
||||
handleUserInput() {
|
||||
const message = this.userInput.value.trim();
|
||||
if (message) {
|
||||
this.addMessage('user', message);
|
||||
this.generateResponse(message);
|
||||
this.userInput.value = '';
|
||||
$(document).ready(function(){
|
||||
// Add smooth scrolling
|
||||
$('a[href^="#"]').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
var target = $(this.getAttribute('href'));
|
||||
if( target.length ) {
|
||||
$('html, body').stop().animate({
|
||||
scrollTop: target.offset().top
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
addMessage(type, content) {
|
||||
const messageDiv = document.createElement('div');
|
||||
messageDiv.className = `message ${type}-message`;
|
||||
messageDiv.innerHTML = `
|
||||
<div class="message-content">
|
||||
<span class="message-text">${content}</span>
|
||||
<span class="timestamp">${new Date().toLocaleTimeString()}</span>
|
||||
</div>
|
||||
`;
|
||||
this.chatMessages.appendChild(messageDiv);
|
||||
this.chatMessages.scrollTop = this.chatMessages.scrollHeight;
|
||||
}
|
||||
|
||||
generateResponse(userMessage) {
|
||||
// Simulate AI processing
|
||||
setTimeout(() => {
|
||||
const responses = [
|
||||
"I understand your query about " + userMessage,
|
||||
"Processing your request regarding " + userMessage,
|
||||
"Analyzing the context of " + userMessage,
|
||||
"Interesting perspective on " + userMessage
|
||||
];
|
||||
const response = responses[Math.floor(Math.random() * responses.length)];
|
||||
this.addMessage('ai', response);
|
||||
this.updateMetrics();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
initializeNeuralNetwork() {
|
||||
this.resizeCanvas();
|
||||
this.nodes = [];
|
||||
this.connections = [];
|
||||
|
||||
// Create nodes
|
||||
for (let layer = 0; layer < 3; layer++) {
|
||||
const nodesInLayer = layer === 1 ? 4 : 3;
|
||||
for (let i = 0; i < nodesInLayer; i++) {
|
||||
this.nodes.push({
|
||||
x: (layer + 1) * this.canvas.width / 4,
|
||||
y: (i + 1) * this.canvas.height / (nodesInLayer + 1),
|
||||
layer: layer
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Create connections
|
||||
this.nodes.forEach(node => {
|
||||
if (node.layer < 2) {
|
||||
this.nodes.filter(n => n.layer === node.layer + 1).forEach(nextNode => {
|
||||
this.connections.push({
|
||||
start: node,
|
||||
end: nextNode,
|
||||
activity: Math.random()
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.animate();
|
||||
}
|
||||
|
||||
resizeCanvas() {
|
||||
this.canvas.width = this.canvas.offsetWidth;
|
||||
this.canvas.height = this.canvas.offsetHeight;
|
||||
}
|
||||
|
||||
animate() {
|
||||
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
||||
|
||||
// Draw connections
|
||||
this.connections.forEach(conn => {
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(conn.start.x, conn.start.y);
|
||||
this.ctx.lineTo(conn.end.x, conn.end.y);
|
||||
this.ctx.strokeStyle = `rgba(52, 152, 219, ${conn.activity})`;
|
||||
this.ctx.lineWidth = 2;
|
||||
this.ctx.stroke();
|
||||
|
||||
conn.activity = Math.max(0.1, Math.min(1, conn.activity + (Math.random() - 0.5) * 0.1));
|
||||
});
|
||||
|
||||
// Draw nodes
|
||||
this.nodes.forEach(node => {
|
||||
this.ctx.beginPath();
|
||||
this.ctx.arc(node.x, node.y, 10, 0, Math.PI * 2);
|
||||
this.ctx.fillStyle = '#3498db';
|
||||
this.ctx.fill();
|
||||
});
|
||||
|
||||
requestAnimationFrame(() => this.animate());
|
||||
}
|
||||
|
||||
updateMetrics() {
|
||||
const processingPowerValue = Math.random() * 100;
|
||||
const learningRateValue = Math.random() * 100;
|
||||
|
||||
this.processingPower.style.width = `${processingPowerValue}%`;
|
||||
this.learningRate.style.width = `${learningRateValue}%`;
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize the application
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const agi = new AGIInterface();
|
||||
// Add parallax effect to hero images
|
||||
$(window).scroll(function(){
|
||||
var scrolled = $(window).scrollTop();
|
||||
$('.hero').css('background-position-y', -(scrolled * 0.5));
|
||||
});
|
||||
});
|
|
@ -0,0 +1,69 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Space Details - Workspace</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<!-- Include navigation.html content here -->
|
||||
</nav>
|
||||
|
||||
<section class="hero">
|
||||
<div class="container">
|
||||
<h1>Modern Downtown Office</h1>
|
||||
<p>New York, NY</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="gallery">
|
||||
<img src="https://images.unsplash.com/photo-1584622650111-993a426fbf0a?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80" alt="Space" class="img-fluid">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Details</h3>
|
||||
<p class="card-text"><i class="fas fa-users"></i> 1-10 people</p>
|
||||
<p class="card-text"><i class="fas fa-wifi"></i> WiFi</p>
|
||||
<p class="card-text"><i class="fas fa-parking"></i> Parking</p>
|
||||
<p class="card-text">$50/day</p>
|
||||
<button class="btn btn-dark w-100">Book Now</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title">Description</h3>
|
||||
<p class="card-text">Modern office space in the heart of downtown with natural light, high-speed internet, and all necessary amenities.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,150 +1,69 @@
|
|||
:root {
|
||||
--primary-color: #2c3e50;
|
||||
--secondary-color: #3498db;
|
||||
--accent-color: #e74c3c;
|
||||
--background-color: #f5f6fa;
|
||||
--text-color: #2c3e50;
|
||||
--primary-color: #000;
|
||||
--secondary-color: #444;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
/* Navigation */
|
||||
.navbar-brand {
|
||||
font-weight: 700;
|
||||
font-size: 24px;
|
||||
color: var(--primary-color) !important;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'Arial', sans-serif;
|
||||
background-color: var(--background-color);
|
||||
color: var(--text-color);
|
||||
/* Hero Sections */
|
||||
.hero {
|
||||
height: 60vh;
|
||||
background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1584622650111-993a426fbf0a?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80');
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
color: white;
|
||||
text-align: center;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* Cards */
|
||||
.card {
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
transform: translateY(-5px);
|
||||
}
|
||||
|
||||
/* Buttons */
|
||||
.btn-dark {
|
||||
background: var(--primary-color);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
padding: 10px 20px;
|
||||
}
|
||||
|
||||
.btn-dark:hover {
|
||||
background: #333;
|
||||
}
|
||||
|
||||
/* Forms */
|
||||
.form-control {
|
||||
border-radius: 5px;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
.footer {
|
||||
background: var(--primary-color);
|
||||
color: white;
|
||||
padding: 50px 0;
|
||||
margin-top: 100px;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px 0;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: var(--primary-color);
|
||||
font-size: 2.5em;
|
||||
}
|
||||
|
||||
.status-indicator {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.pulse {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-color: #2ecc71;
|
||||
border-radius: 50%;
|
||||
animation: pulse 2s infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0% { transform: scale(1); opacity: 1; }
|
||||
50% { transform: scale(1.5); opacity: 0.7; }
|
||||
100% { transform: scale(1); opacity: 1; }
|
||||
}
|
||||
|
||||
main {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 30px;
|
||||
}
|
||||
|
||||
.interaction-panel, .visualization-panel {
|
||||
background: white;
|
||||
border-radius: 15px;
|
||||
padding: 20px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.chat-interface {
|
||||
height: 500px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.messages {
|
||||
flex-grow: 1;
|
||||
overflow-y: auto;
|
||||
padding: 15px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.input-area {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
flex-grow: 1;
|
||||
padding: 12px;
|
||||
border: 2px solid #e0e0e0;
|
||||
border-radius: 8px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
button {
|
||||
padding: 12px 24px;
|
||||
background-color: var(--secondary-color);
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #2980b9;
|
||||
}
|
||||
|
||||
.neural-network {
|
||||
height: 300px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
canvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.metrics {
|
||||
display: grid;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.metric h3 {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 20px;
|
||||
background-color: #f0f0f0;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.progress {
|
||||
height: 100%;
|
||||
background-color: var(--secondary-color);
|
||||
width: 0%;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
main {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
padding: 0 20px;
|
||||
}
|
|
@ -31,7 +31,8 @@ class ToolExecutionContext:
|
|||
tool_call: Dict[str, Any]
|
||||
tool_index: int
|
||||
result: Optional[ToolResult] = None
|
||||
display_name: Optional[str] = None
|
||||
function_name: Optional[str] = None
|
||||
xml_tag_name: Optional[str] = None
|
||||
error: Optional[Exception] = None
|
||||
|
||||
@dataclass
|
||||
|
@ -212,7 +213,7 @@ class ResponseProcessor:
|
|||
if has_complete_tool_call and config.execute_tools and config.execute_on_stream:
|
||||
# Execute this tool call
|
||||
tool_call_data = {
|
||||
"name": current_tool['function']['name'],
|
||||
"function_name": current_tool['function']['name'],
|
||||
"arguments": json.loads(current_tool['function']['arguments']),
|
||||
"id": current_tool['id']
|
||||
}
|
||||
|
@ -343,7 +344,8 @@ class ResponseProcessor:
|
|||
formatted_result = self._format_xml_tool_result(tool_call, result)
|
||||
yield {
|
||||
"type": "tool_result",
|
||||
"name": context.display_name,
|
||||
"function_name": context.function_name,
|
||||
"xml_tag_name": context.xml_tag_name,
|
||||
"result": formatted_result,
|
||||
"tool_index": tool_index
|
||||
}
|
||||
|
@ -405,7 +407,7 @@ class ResponseProcessor:
|
|||
if config.native_tool_calling and complete_native_tool_calls:
|
||||
for tool_call in complete_native_tool_calls:
|
||||
tool_calls_to_execute.append({
|
||||
"name": tool_call["function"]["name"],
|
||||
"function_name": tool_call["function"]["name"],
|
||||
"arguments": tool_call["function"]["arguments"],
|
||||
"id": tool_call["id"]
|
||||
})
|
||||
|
@ -492,7 +494,7 @@ class ResponseProcessor:
|
|||
for tool_call in response_message.tool_calls:
|
||||
if hasattr(tool_call, 'function'):
|
||||
tool_calls.append({
|
||||
"name": tool_call.function.name,
|
||||
"function_name": tool_call.function.name,
|
||||
"arguments": json.loads(tool_call.function.arguments) if isinstance(tool_call.function.arguments, str) else tool_call.function.arguments,
|
||||
"id": tool_call.id if hasattr(tool_call, 'id') else str(uuid.uuid4())
|
||||
})
|
||||
|
@ -870,12 +872,12 @@ class ResponseProcessor:
|
|||
return []
|
||||
|
||||
try:
|
||||
tool_names = [t.get('name', 'unknown') for t in tool_calls]
|
||||
tool_names = [t.get('function_name', 'unknown') for t in tool_calls]
|
||||
logger.info(f"Executing {len(tool_calls)} tools sequentially: {tool_names}")
|
||||
|
||||
results = []
|
||||
for index, tool_call in enumerate(tool_calls):
|
||||
tool_name = tool_call.get('name', 'unknown')
|
||||
tool_name = tool_call.get('function_name', 'unknown')
|
||||
logger.debug(f"Executing tool {index+1}/{len(tool_calls)}: {tool_name}")
|
||||
|
||||
try:
|
||||
|
@ -893,8 +895,8 @@ class ResponseProcessor:
|
|||
except Exception as e:
|
||||
logger.error(f"Error in sequential tool execution: {str(e)}", exc_info=True)
|
||||
# Return partial results plus error results for remaining tools
|
||||
completed_tool_names = [r[0].get('name', 'unknown') for r in results] if 'results' in locals() else []
|
||||
remaining_tools = [t for t in tool_calls if t.get('name', 'unknown') not in completed_tool_names]
|
||||
completed_tool_names = [r[0].get('function_name', 'unknown') for r in results] if 'results' in locals() else []
|
||||
remaining_tools = [t for t in tool_calls if t.get('function_name', 'unknown') not in completed_tool_names]
|
||||
|
||||
# Add error results for remaining tools
|
||||
error_results = [(tool, ToolResult(success=False, output=f"Execution error: {str(e)}"))
|
||||
|
@ -918,7 +920,7 @@ class ResponseProcessor:
|
|||
return []
|
||||
|
||||
try:
|
||||
tool_names = [t.get('name', 'unknown') for t in tool_calls]
|
||||
tool_names = [t.get('function_name', 'unknown') for t in tool_calls]
|
||||
logger.info(f"Executing {len(tool_calls)} tools in parallel: {tool_names}")
|
||||
|
||||
# Create tasks for all tool calls
|
||||
|
@ -931,7 +933,7 @@ class ResponseProcessor:
|
|||
processed_results = []
|
||||
for i, (tool_call, result) in enumerate(zip(tool_calls, results)):
|
||||
if isinstance(result, Exception):
|
||||
logger.error(f"Error executing tool {tool_call.get('name', 'unknown')}: {str(result)}")
|
||||
logger.error(f"Error executing tool {tool_call.get('function_name', 'unknown')}: {str(result)}")
|
||||
# Create error result
|
||||
error_result = ToolResult(success=False, output=f"Error executing tool: {str(result)}")
|
||||
processed_results.append((tool_call, error_result))
|
||||
|
@ -1004,25 +1006,6 @@ class ResponseProcessor:
|
|||
function_name = tool_call["function_name"]
|
||||
return f"Result for {function_name}: {str(result)}"
|
||||
|
||||
def _get_tool_display_name(self, function_name: str) -> str:
|
||||
"""Get the XML tag name for a function name.
|
||||
|
||||
Args:
|
||||
function_name: The function name to look up
|
||||
|
||||
Returns:
|
||||
The XML tag name if found, otherwise the original function name
|
||||
"""
|
||||
if not hasattr(self.tool_registry, 'xml_tools'):
|
||||
return function_name
|
||||
|
||||
# Check if this function corresponds to an XML tool
|
||||
for tag_name, xml_tool_info in self.tool_registry.xml_tools.items():
|
||||
if xml_tool_info.get('method') == function_name:
|
||||
return tag_name
|
||||
|
||||
# Default to the function name if no XML tag found
|
||||
return function_name
|
||||
|
||||
# At class level, define a method for yielding tool results
|
||||
def _yield_tool_result(self, context: ToolExecutionContext) -> Dict[str, Any]:
|
||||
|
@ -1030,7 +1013,8 @@ class ResponseProcessor:
|
|||
if not context.result:
|
||||
return {
|
||||
"type": "tool_result",
|
||||
"name": context.display_name,
|
||||
"function_name": context.function_name,
|
||||
"xml_tag_name": context.xml_tag_name,
|
||||
"result": "No result available",
|
||||
"tool_index": context.tool_index
|
||||
}
|
||||
|
@ -1038,7 +1022,8 @@ class ResponseProcessor:
|
|||
formatted_result = self._format_xml_tool_result(context.tool_call, context.result)
|
||||
return {
|
||||
"type": "tool_result",
|
||||
"name": context.display_name,
|
||||
"function_name": context.function_name,
|
||||
"xml_tag_name": context.xml_tag_name,
|
||||
"result": formatted_result,
|
||||
"tool_index": context.tool_index
|
||||
}
|
||||
|
@ -1050,22 +1035,26 @@ class ResponseProcessor:
|
|||
tool_index=tool_index
|
||||
)
|
||||
|
||||
# Always use xml_tag_name if it exists
|
||||
# Set function_name and xml_tag_name fields
|
||||
if "xml_tag_name" in tool_call:
|
||||
context.display_name = tool_call["xml_tag_name"]
|
||||
context.xml_tag_name = tool_call["xml_tag_name"]
|
||||
context.function_name = tool_call.get("function_name", tool_call["xml_tag_name"])
|
||||
else:
|
||||
# For non-XML tools, use function name directly
|
||||
context.display_name = tool_call["function_name"]
|
||||
context.function_name = tool_call.get("function_name", "unknown")
|
||||
context.xml_tag_name = None
|
||||
|
||||
return context
|
||||
|
||||
def _yield_tool_started(self, context: ToolExecutionContext) -> Dict[str, Any]:
|
||||
"""Format and return a tool started status message."""
|
||||
tool_name = context.xml_tag_name or context.function_name
|
||||
return {
|
||||
"type": "tool_status",
|
||||
"status": "started",
|
||||
"name": context.display_name,
|
||||
"message": f"Starting execution of {context.display_name}",
|
||||
"function_name": context.function_name,
|
||||
"xml_tag_name": context.xml_tag_name,
|
||||
"message": f"Starting execution of {tool_name}",
|
||||
"tool_index": context.tool_index
|
||||
}
|
||||
|
||||
|
@ -1074,21 +1063,25 @@ class ResponseProcessor:
|
|||
if not context.result:
|
||||
return self._yield_tool_error(context)
|
||||
|
||||
tool_name = context.xml_tag_name or context.function_name
|
||||
return {
|
||||
"type": "tool_status",
|
||||
"status": "completed" if context.result.success else "failed",
|
||||
"name": context.display_name,
|
||||
"message": f"Tool {context.display_name} {'completed successfully' if context.result.success else 'failed'}",
|
||||
"function_name": context.function_name,
|
||||
"xml_tag_name": context.xml_tag_name,
|
||||
"message": f"Tool {tool_name} {'completed successfully' if context.result.success else 'failed'}",
|
||||
"tool_index": context.tool_index
|
||||
}
|
||||
|
||||
def _yield_tool_error(self, context: ToolExecutionContext) -> Dict[str, Any]:
|
||||
"""Format and return a tool error status message."""
|
||||
error_msg = str(context.error) if context.error else "Unknown error"
|
||||
tool_name = context.xml_tag_name or context.function_name
|
||||
return {
|
||||
"type": "tool_status",
|
||||
"status": "error",
|
||||
"name": context.display_name,
|
||||
"function_name": context.function_name,
|
||||
"xml_tag_name": context.xml_tag_name,
|
||||
"message": f"Error executing tool: {error_msg}",
|
||||
"tool_index": context.tool_index
|
||||
}
|
Loading…
Reference in New Issue