🎯 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
70 lines
2.5 KiB
JavaScript
70 lines
2.5 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 * as MessagesAPI from "./messages.mjs";
|
|
import { Messages } from "./messages.mjs";
|
|
import { CursorPage } from "../../../pagination.mjs";
|
|
export class Completions extends APIResource {
|
|
constructor() {
|
|
super(...arguments);
|
|
this.messages = new MessagesAPI.Messages(this._client);
|
|
}
|
|
create(body, options) {
|
|
return this._client.post('/chat/completions', { body, ...options, stream: body.stream ?? false });
|
|
}
|
|
/**
|
|
* Get a stored chat completion. Only Chat Completions that have been created with
|
|
* the `store` parameter set to `true` will be returned.
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* const chatCompletion =
|
|
* await client.chat.completions.retrieve('completion_id');
|
|
* ```
|
|
*/
|
|
retrieve(completionId, options) {
|
|
return this._client.get(`/chat/completions/${completionId}`, options);
|
|
}
|
|
/**
|
|
* Modify a stored chat completion. Only Chat Completions that have been created
|
|
* with the `store` parameter set to `true` can be modified. Currently, the only
|
|
* supported modification is to update the `metadata` field.
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* const chatCompletion = await client.chat.completions.update(
|
|
* 'completion_id',
|
|
* { metadata: { foo: 'string' } },
|
|
* );
|
|
* ```
|
|
*/
|
|
update(completionId, body, options) {
|
|
return this._client.post(`/chat/completions/${completionId}`, { body, ...options });
|
|
}
|
|
list(query = {}, options) {
|
|
if (isRequestOptions(query)) {
|
|
return this.list({}, query);
|
|
}
|
|
return this._client.getAPIList('/chat/completions', ChatCompletionsPage, { query, ...options });
|
|
}
|
|
/**
|
|
* Delete a stored chat completion. Only Chat Completions that have been created
|
|
* with the `store` parameter set to `true` can be deleted.
|
|
*
|
|
* @example
|
|
* ```ts
|
|
* const chatCompletionDeleted =
|
|
* await client.chat.completions.del('completion_id');
|
|
* ```
|
|
*/
|
|
del(completionId, options) {
|
|
return this._client.delete(`/chat/completions/${completionId}`, options);
|
|
}
|
|
}
|
|
export class ChatCompletionsPage extends CursorPage {
|
|
}
|
|
export class ChatCompletionStoreMessagesPage extends CursorPage {
|
|
}
|
|
Completions.ChatCompletionsPage = ChatCompletionsPage;
|
|
Completions.Messages = Messages;
|
|
//# sourceMappingURL=completions.mjs.map
|