Skip to content

Request Aborted Error #40

@selected-pixel-jameson

Description

@selected-pixel-jameson

Whenever I make more than one request at a time using the Experts library I get an error stating that my request was aborted.

Error: Request was aborted.
at OpenAI.makeRequest (file:///Users/jamesonparker/Documents/keycollector/key-collector-api/node_modules/openai/core.mjs:289:23)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async AssistantStream._createAssistantStream (file:///Users/jamesonparker/Documents/keycollector/key-collector-api/node_modules/openai/lib/AssistantStream.mjs:213:24)
at async AssistantStream._runAssistantStream (file:///Users/jamesonparker/Documents/keycollector/key-collector-api/node_modules/openai/lib/AbstractAssistantStreamRunner.mjs:200:16)

This is the code that I'm running.

const database = require('../../database');

let Thread;
let Assistant;
let characterDetailAssistant;
let instructions;

(async () => {

	instructions = `.....instructions placeholder.....`

	// Initialize Assistant and Thread globally
	const Experts = await import('experts');
	Thread = Experts.Thread;
	Assistant = Experts.Assistant;

	myAssistant = await Assistant.create({
		id: 'xxxxxxxxxx',
		name: 'xxxxxxxxxx',
		instructions: instructions,
		model: 'gpt-4o-mini',
		temperature: 0.1,
		response_format: {
			"type": "json_object"
		}
	});


})();

module.exports.parseEbayTitle = async (title) => {

	let thread = await Thread.create();
	let response = await myAssistant.ask(title, thread.id);

	response = JSON.parse(response);
	return response;
}

This is used in a job server where I queue up multiple jobs. If I have the job server queue set to run anything more than 1 job at a time I start to get the "Request Aborted" errors. My rate limit is at 5,000 RPM and I'm getting about 1 request back a second so I'm not even close to the lim it here.

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions