Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal server error attempting to call threads.runs with tools #90

Open
madc0w opened this issue Feb 21, 2025 · 0 comments
Open

internal server error attempting to call threads.runs with tools #90

madc0w opened this issue Feb 21, 2025 · 0 comments

Comments

@madc0w
Copy link

madc0w commented Feb 21, 2025

This call:

import { patch } from 'astra-assistants';
import OpenAI from 'openai';
const originalOpenai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
const openaiBot = patch(originalOpenai);

openaiBot.beta.threads.runs.create.bind(openaiBot.beta.threads.runs)(
    threadId,
    {
      assistant_id: process.env.OPENAI_ASSISTANT_ID,
      truncation_strategy: { type: 'last_messages', last_messages: 10 },
      stream: true,
      instructions: config.instructions,
      tools: [
      {
      	type: 'function',
      	function: {
      		name: 'scan_website',
      	},
      },
      ],
      additional_instructions: config.additionalInstructions,
      },
    
)

results in a server error (HTTP 500).
This works fine if no tools are passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant