🎯 Major improvements to MissionControl component: - Always keep input field visible and functional after AI responses - Auto-clear input after submitting questions for better UX - Add dynamic visual indicators (first question vs follow-up) - Improve response layout with clear separation and hints - Enable proper chat-like experience for continuous learning 🌟 Additional enhancements: - Better language-specific messaging throughout interface - Clearer visual hierarchy between input and response areas - Intuitive flow that guides users to ask follow-up questions - Maintains responsive design and accessibility 🔧 Technical changes: - Enhanced MissionControl state management - Improved component layout and styling - Better TypeScript integration across components - Updated tsconfig for stricter type checking
90 lines
3.1 KiB
JavaScript
90 lines
3.1 KiB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
import { APIResource } from "../../../resource.mjs";
|
|
import { isRequestOptions } from "../../../core.mjs";
|
|
import { AssistantStream } from "../../../lib/AssistantStream.mjs";
|
|
import * as MessagesAPI from "./messages.mjs";
|
|
import { Messages, MessagesPage, } from "./messages.mjs";
|
|
import * as RunsAPI from "./runs/runs.mjs";
|
|
import { Runs, RunsPage, } from "./runs/runs.mjs";
|
|
/**
|
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
*/
|
|
export class Threads extends APIResource {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.runs = new RunsAPI.Runs(this._client);
|
|
this.messages = new MessagesAPI.Messages(this._client);
|
|
}
|
|
create(body = {}, options) {
|
|
if (isRequestOptions(body)) {
|
|
return this.create({}, body);
|
|
}
|
|
return this._client.post('/threads', {
|
|
body,
|
|
...options,
|
|
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
|
|
});
|
|
}
|
|
/**
|
|
* Retrieves a thread.
|
|
*
|
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
*/
|
|
retrieve(threadId, options) {
|
|
return this._client.get(`/threads/${threadId}`, {
|
|
...options,
|
|
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
|
|
});
|
|
}
|
|
/**
|
|
* Modifies a thread.
|
|
*
|
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
*/
|
|
update(threadId, body, options) {
|
|
return this._client.post(`/threads/${threadId}`, {
|
|
body,
|
|
...options,
|
|
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
|
|
});
|
|
}
|
|
/**
|
|
* Delete a thread.
|
|
*
|
|
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
|
*/
|
|
del(threadId, options) {
|
|
return this._client.delete(`/threads/${threadId}`, {
|
|
...options,
|
|
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
|
|
});
|
|
}
|
|
createAndRun(body, options) {
|
|
return this._client.post('/threads/runs', {
|
|
body,
|
|
...options,
|
|
headers: { 'OpenAI-Beta': 'assistants=v2', ...options?.headers },
|
|
stream: body.stream ?? false,
|
|
});
|
|
}
|
|
/**
|
|
* A helper to create a thread, start a run and then poll for a terminal state.
|
|
* More information on Run lifecycles can be found here:
|
|
* https://platform.openai.com/docs/assistants/how-it-works/runs-and-run-steps
|
|
*/
|
|
async createAndRunPoll(body, options) {
|
|
const run = await this.createAndRun(body, options);
|
|
return await this.runs.poll(run.thread_id, run.id, options);
|
|
}
|
|
/**
|
|
* Create a thread and stream the run back
|
|
*/
|
|
createAndRunStream(body, options) {
|
|
return AssistantStream.createThreadAssistantStream(body, this._client.beta.threads, options);
|
|
}
|
|
}
|
|
Threads.Runs = Runs;
|
|
Threads.RunsPage = RunsPage;
|
|
Threads.Messages = Messages;
|
|
Threads.MessagesPage = MessagesPage;
|
|
//# sourceMappingURL=threads.mjs.map
|