Service: OpenAI Assistant - EyevinnOSC/community GitHub Wiki

OpenAI Assistant

OpenAI Assistant (serviceId boldare-openai-assistant) is a ready-to-deploy chatbot application built on the OpenAI Assistants API. It wraps an existing OpenAI Assistant (configured on platform.openai.com) with a chat UI that you can embed in a website or use standalone. In Eyevinn Open Source Cloud (OSC) it is a long-running service instance. License: MIT. Source: boldare/openai-assistant.

What it can do

  • Provide a chat UI for an OpenAI Assistant you have already created.
  • Be embedded in a website with an iframe; CORS is configured for the domain given in AppUrl.

Creating an instance

Prerequisites: an OpenAI account with an API key (sk-...) and an OpenAI Assistant created at platform.openai.com/assistants (give it a name, instructions and a model; copy its Assistant ID, which looks like asst_abc123...).

Store the API key as a secret with create-service-secret (serviceId: "boldare-openai-assistant", name openaikey), then call create-service-instance:

{
  "name": "mychatbot",
  "OpenAiApiKey": "{{secrets.openaikey}}",
  "AssistantId": "asst_abc123...",
  "AppUrl": "https://www.example.com"
}

Verify with wait-for-service-ready or get-instance-status; describe-service-instance returns the instance URL, which opens the chatbot UI.

Options

Option Required Type Meaning
name Yes string Name of the instance. Alphanumeric/underscore only (^\w+$), at most 20 characters.
OpenAiApiKey Yes string, sensitive OpenAI API key (starts with sk-). Store it as a secret and pass {{secrets.NAME}}.
AssistantId Yes string ID of your existing OpenAI Assistant, for example asst_abc123....
AppUrl No string URL of the website where the chat will be embedded; the service configures CORS to allow embedding from that domain.

{{secrets.NAME}} only works as the entire field value. Overwriting a secret does not restart a running instance.

Using the instance

Embed it in a page with an iframe (set AppUrl to that site's URL):

<iframe
  src="https://your-instance-url"
  width="400"
  height="600"
  style="border: none;"
></iframe>

OSC CLI equivalent of creating the instance:

osc create boldare-openai-assistant my-chatbot \
  -o OpenAiApiKey="sk-..." \
  -o AssistantId="asst_abc123..."

Resources

⚠️ **GitHub.com Fallback** ⚠️