#Webinar

1 messages · Page 1 of 1 (latest)

shell bloom
#

I will run a webinar for newbies regarding ai assistants. We are going to work with bubble.io as the platform where everything is developed.
How would you define OpenAI Assistants in a way that attracts people participating from this webinar?

tender heraldBOT
#

Hi @shell bloom. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

OpenAI Assistants are powerful AI entities that can be integrated into your own applications, making them an exciting tool for anyone interested in leveraging AI technology. These Assistants are powered by advanced language models like GPT-4, which have been trained to understand and generate natural language. This means they can perform a wide variety of tasks based on the instructions they're given, from generating content to running code or retrieving information from a file.

What makes OpenAI Assistants particularly attractive is their versatility. They can access multiple tools in parallel, including both OpenAI-hosted tools and tools you build or host yourself. This means they can be customized to suit a wide range of applications, making them a valuable tool for developers of all levels.

Moreover, OpenAI Assistants can maintain persistent threads, simplifying application development by storing message history and truncating it when the conversation gets too long for the model’s context length. They can also access files in several formats, either as part of their creation or as part of Threads between Assistants and users.

In a nutshell, OpenAI Assistants offer a powerful, flexible, and user-friendly way to integrate AI into your applications, making them a must-learn tool for anyone interested in AI development.

For more information, you can refer to the OpenAI Assistants API Overview (https://platform.openai.com/docs/assistants/overview) and the Assistants API Quickstart Guide (https://platform.openai.com/docs/assistants/quickstart).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@shell bloom Kapa.ai is still learning and improving, please let me know how I did by reacting below.

shell bloom
#

@tender herald which are the most used capabilities of ai assistants?

tender heraldBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

AI Assistants, particularly those developed by OpenAI, have a wide range of capabilities that can be leveraged for various tasks. Some of the most commonly used capabilities include:

  1. Calling Models: Assistants can call OpenAI’s models with specific instructions to tune their personality and capabilities. This allows them to perform tasks like language translation, content generation, and more. Source (https://platform.openai.com/docs/assistants/overview)

  2. Accessing Multiple Tools: Assistants can access multiple tools in parallel. These can be both OpenAI-hosted tools — like code_interpreter and file_search — or tools you build/host. This allows them to perform complex tasks and interact with your application. Source (https://platform.openai.com/docs/assistants/overview)

  3. Persistent Threads: Assistants can access persistent Threads. Threads simplify AI application development by storing message history and truncating it when the conversation gets too long for the model’s context length. Source (https://platform.openai.com/docs/assistants/overview)

  4. File Access and Creation: Assistants can access files in several formats — either as part of their creation or as part of Threads between Assistants and users. When using tools, Assistants can also create files (e.g., images, spreadsheets, etc) and cite files they reference in the Messages they create. Source (https://platform.openai.com/docs/assistants/overview)

  5. Function Calling: Assistants can use custom functions to interact with your application. This can be used for tasks like data retrieval, task automation, computational tasks, and customer support. Source (https://platform.openai.com/docs/guides/function-calling)

#
  1. Web Browsing: Some AI Assistants, like ChatGPT, have the ability to search the internet for additional information it needs to answer questions and complete tasks. Source (https://help.openai.com/en/articles/9260256-chatgpt-capabilities-overview#h_87b98a8413)

  2. Image Processing: When you upload an image as part of your prompt, ChatGPT uses the GPT Vision model to interpret the image. This enables ChatGPT to answer questions about the image, or use information in the image as context for other prompts. Source (https://help.openai.com/en/articles/9260256-chatgpt-capabilities-overview#h_87b98a8413)

These capabilities make AI Assistants a powerful tool for a wide range of applications.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@shell bloom Kapa.ai is still learning and improving, please let me know how I did by reacting below.

shell bloom
#

@tender herald how do ai assistants work?

tender heraldBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

AI Assistants, such as those developed by OpenAI, work by leveraging advanced language models like GPT-4 to understand and generate natural language. Here's a basic overview of how they work:

  1. Calling Models: AI Assistants call OpenAI’s models with specific instructions to tune their personality and capabilities. This allows them to perform tasks like language translation, content generation, and more.

  2. Accessing Tools: AI Assistants can access multiple tools in parallel. These can be both OpenAI-hosted tools — like code_interpreter and file_search — or tools you build/host. This allows them to perform complex tasks and interact with your application.

  3. Persistent Threads: AI Assistants can access persistent Threads. Threads simplify AI application development by storing message history and truncating it when the conversation gets too long for the model’s context length. You create a Thread once, and simply append Messages to it as your users reply.

  4. File Access and Creation: AI Assistants can access files in several formats — either as part of their creation or as part of Threads between Assistants and users. When using tools, Assistants can also create files (e.g., images, spreadsheets, etc) and cite files they reference in the Messages they create.

  5. Function Calling: AI Assistants can use custom functions to interact with your application. This can be used for tasks like data retrieval, task automation, computational tasks, and customer support.

For more detailed information, you can refer to the OpenAI Assistants API Overview (https://platform.openai.com/docs/assistants/overview).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@shell bloom Kapa.ai is still learning and improving, please let me know how I did by reacting below.

shell bloom
#

@tender herald can you describe the api calling sequence to run an assistant?

tender heraldBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

Sure, here's a basic sequence of API calls to run an OpenAI Assistant:

  1. Create an Assistant: The first step is to create an Assistant by defining its custom instructions and picking a model. You can also add files and enable tools like Code Interpreter, File Search, and Function calling. Here's an example of how to create an Assistant using OpenAI's Python SDK:
from openai import OpenAI
client = OpenAI()

assistant = client.beta.assistants.create(
  name="Math Tutor",
  instructions="You are a personal math tutor. Write and run code to answer math questions.",
  tools=[{"type": "code_interpreter"}],
  model="gpt-4o",
)

Source (https://platform.openai.com/docs/assistants/quickstart)

  1. Create a Thread: When a user starts a conversation, you create a Thread. The Thread is where the conversation between the user and the Assistant takes place.

  2. Add Messages to the Thread: As the user asks questions, you add Messages to the Thread. Messages can be from the user or the assistant and contain the content of the conversation.

  3. Run the Assistant on the Thread: Finally, you run the Assistant on the Thread to generate a response. This involves calling the model and the tools associated with the Assistant. The responses are added to the Thread as assistant Messages. Here's an example of how to create a Run and stream the response using OpenAI's Python SDK:

#
from typing_extensions import override
from openai import AssistantEventHandler
 
class EventHandler(AssistantEventHandler):    
  @override
  def on_text_created(self, text) -> None:
    print(f"\nassistant > ", end="", flush=True)
      
  @override
  def on_text_delta(self, delta, snapshot):
    print(delta.value, end="", flush=True)
      
  def on_tool_call_created(self, tool_call):
    print(f"\nassistant > {tool_call.type}\n", flush=True)
  
  def on_tool_call_delta(self, delta, snapshot):
    if delta.type == 'code_interpreter':
      if delta.code_interpreter.input:
        print(delta.code_interpreter.input, end="", flush=True)
      if delta.code_interpreter.outputs:
        print(f"\n\noutput >", flush=True)
        for output in delta.code_interpreter.outputs:
          if output.type == "logs":
            print(f"\n{output.logs}", flush=True)
 
with client.beta.threads.runs.stream(
  thread_id=thread.id,
  assistant_id=assistant.id,
  instructions="Please address the user as Jane Doe. The user has a premium account.",
  event_handler=EventHandler(),
) as stream:
  stream.until_done()

Source (https://platform.openai.com/docs/assistants/quickstart)

Please note that calls to the Assistants API require that you pass a beta HTTP header. This is handled automatically if you’re using OpenAI’s official Python or Node.js SDKs. The header is OpenAI-Beta: assistants=v2.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@shell bloom Kapa.ai is still learning and improving, please let me know how I did by reacting below.

shell bloom
#

@tender herald what are the different type of run status that can be found and what should we do with each of them?

tender heraldBOT
#

Let me check the knowledge base for you again. One moment! :books:

#

Run objects in OpenAI Assistants can have multiple statuses, each indicating a different stage of the run lifecycle. Here's what each status means and what you should do with them:

  1. queued: When Runs are first created or when you complete the required_action, they are moved to a queued status. They should almost immediately move to in_progress. There's usually no action needed from your side at this stage.

  2. in_progress: While in progress, the Assistant uses the model and tools to perform steps. You can view progress being made by the Run by examining the Run Steps. No action is needed from your side at this stage, but you can monitor the progress if needed.

  3. completed: The Run successfully completed! You can now view all Messages the Assistant added to the Thread, and all the steps the Run took. You can also continue the conversation by adding more user Messages to the Thread and creating another Run.

  4. requires_action: When using the Function calling tool, the Run will move to a required_action state once the model determines the names and arguments of the functions to be called. You must then run those functions and submit the outputs before the run proceeds. If the outputs are not provided before the expires_at timestamp passes (roughly 10 mins past creation), the run will move to an expired status.

  5. expired: This happens when the function calling outputs were not submitted before expires_at and the run expires. Additionally, if the runs take too long to execute and go beyond the time stated in expires_at, OpenAI's systems will expire the run. If a run expires, you may need to start a new run.

#
  1. cancelling: You can attempt to cancel an in_progress run using the Cancel Run endpoint. Once the attempt to cancel succeeds, the status of the Run moves to cancelled. Cancellation is attempted but not guaranteed.

  2. cancelled: The Run was successfully cancelled. If a run is cancelled, you may need to start a new run if you still need the results.

For more information, you can refer to the OpenAI Assistants API Deep Dive (https://platform.openai.com/docs/assistants/deep-dive).

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: