Initial commit: KidsAI Explorer with complete functionality
- Complete KidsAI Explorer application - Multi-language support (English/German) - AI-powered educational guidance using OpenAI - Interactive chat interface for children - Proper placeholder translation fixes - Mobile-responsive design - Educational framework for critical thinking
This commit is contained in:
91
node_modules/openai/resources/beta/threads/threads.mjs
generated
vendored
Normal file
91
node_modules/openai/resources/beta/threads/threads.mjs
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
||||
import { APIResource } from "../../../core/resource.mjs";
|
||||
import * as MessagesAPI from "./messages.mjs";
|
||||
import { Messages, } from "./messages.mjs";
|
||||
import * as RunsAPI from "./runs/runs.mjs";
|
||||
import { Runs, } from "./runs/runs.mjs";
|
||||
import { buildHeaders } from "../../../internal/headers.mjs";
|
||||
import { AssistantStream } from "../../../lib/AssistantStream.mjs";
|
||||
import { path } from "../../../internal/utils/path.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 a thread.
|
||||
*
|
||||
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
||||
*/
|
||||
create(body = {}, options) {
|
||||
return this._client.post('/threads', {
|
||||
body,
|
||||
...options,
|
||||
headers: buildHeaders([{ '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(path `/threads/${threadID}`, {
|
||||
...options,
|
||||
headers: buildHeaders([{ '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(path `/threads/${threadID}`, {
|
||||
body,
|
||||
...options,
|
||||
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Delete a thread.
|
||||
*
|
||||
* @deprecated The Assistants API is deprecated in favor of the Responses API
|
||||
*/
|
||||
delete(threadID, options) {
|
||||
return this._client.delete(path `/threads/${threadID}`, {
|
||||
...options,
|
||||
headers: buildHeaders([{ 'OpenAI-Beta': 'assistants=v2' }, options?.headers]),
|
||||
});
|
||||
}
|
||||
createAndRun(body, options) {
|
||||
return this._client.post('/threads/runs', {
|
||||
body,
|
||||
...options,
|
||||
headers: buildHeaders([{ '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.id, { thread_id: run.thread_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.Messages = Messages;
|
||||
//# sourceMappingURL=threads.mjs.map
|
||||
Reference in New Issue
Block a user