学习中心

Setting Up Chatbot Within COMSOL Multiphysics®


You can interact with a chatbot from within the COMSOL Multiphysics®software using theChatbotwindow. This functionality enables you to:

  • Send general inquiries
  • Generate and debug COMSOL API for Java code
  • Ask questions about modeling with the COMSOL Multiphysics®software

Currently, OpenAI is the only supported provider, and theChatbotwindow is only available for Windows®operating systems. In this article, we will cover how to set up and enable the chatbot tool.

Note: TheChatbotwindow is not included by default when you install COMSOL Multiphysics. You must manually opt to install it before it can be accessed within the software.

A UI screenshot of the Model Builder with the Chatbot window open and the Configure OpenAI API Key dialog open, prompting you to enter an API key to start using the chatbot. A UI screenshot of the Model Builder with the Chatbot window open and the Configure OpenAI API Key dialog open, prompting you to enter an API key to start using the chatbot.

COMSOL Multiphysics with theChatbotwindow opened (bottom right) and the correspondingConfigure API Keydialog open (center). After supplying the API key, the chatbot can be used.

Installing the Chatbot

Before configuring the settings in the software to use the chatbot tool, you must first choose to install chatbot components. By default, the components are not selected to be included in your installation of COMSOL Multiphysics. To include chatbot components, check theChatbot Componentsoption in theSelect products to installwindow of theProductstab of the COMSOL Installer.

A UI screenshot of the COMSOL Installer with the Products tab selected and the Chatbot Components checkbox highlighted.

A screenshot of the COMSOL Multiphysics 6.3 Installer with theProductstab open and theChatbot Componentscheckbox highlighted.

When you have selected theChatbot Componentscheckbox, you can resume the remaining steps to complete your installation of the COMSOL®software. The installation process will vary slightly depending on whether you are updating your currently existing installation of COMSOL Multiphysics versus upgrading your installation to a new major version. Further details on the distinction between these variants and how to install the software are available here: "COMSOL®Installation Companion".

Note: The chatbot is only available for installation for COMSOL Multiphysics version 6.3.

Following this step, you will need to obtain an API key from an AI model platform (OpenAI, currently) to enable use of the chatbot in the software. This process will vary slightly depending on if you access the AI model from a personal account or a corporate account. See the respective instructions below on how to obtain an API key and configure theChatbotwindow.

Obtaining Your Personal Account API Key

OpenAI

The following process is valid for scenarios where there is no centralized management of the OpenAI platform in your organization and you are allowed to use your own personal account:

  1. Register or Log In
    • Start by visiting theOpenAI Platform. Sign up, or log in if you already have an account. Note that OpenAI's API is a separate product from ChatGPT®. Registering for an account may require a valid phone number and email.
  2. Set Your Organization
    • Optionally, go to theSettingsmenu and under theOrganizationsection, set your organization profile according to the instructions provided by OpenAI. The provided name will be displayed in the upper-left corner of the OpenAI Platform web interface. For demonstration purposes, in the screenshots below the displayed organization name is COMSOL. Note, however, that COMSOL does not provide the API key subscription. You would need to provide your own organization's name here.
  3. Set Up Billing
    • The OpenAI API is a pay-as-you-go service. As a result, to use the chatbot tool within COMSOL Multiphysics you must add a valid payment method and top up your credit balance. To do this, go to theBillingsection under theSettingsmenuand follow the provided instructions.
The billing settings are shown after logging into an account on the OpenAI Platform web interface. The billing settings are shown after logging into an account on the OpenAI Platform web interface.

A screenshot of the OpenAI Platform web interface with the menu to create a new project opened.

  1. Create New Project
    • Optionally, in the upper-left corner of the OpenAI Platform web interface, click on theProjectfield, which is next to the organization name. Select the+Create projectbutton and create a new project devoted to chatbot-related tasks. For demonstration purposes, in the screenshots below the custom project name is "for COMSOL".
The OpenAI Platform web interface with a pop-up window that prompts you to enter a name to create a new project. The OpenAI Platform web interface with a pop-up window that prompts you to enter a name to create a new project.

A screenshot of the OpenAI Platform web interface with the menu to create a new project opened.

  1. Generate the API Key
A pop-up window that prompts you to enter a name to generate a new secret API key is shown on the OpenAI Platform web interface. A pop-up window that prompts you to enter a name to generate a new secret API key is shown on the OpenAI Platform web interface.

A screenshot of the OpenAI Platform web interface with the menu to generate a new secret API key opened.

  1. Configure the API Key in COMSOL Multiphysics
    • Open a session of COMSOL Multiphysics. From theHomeribbon tab, under theWindowsbutton, selectChatbotto open theChatbotwindow. Copy the API key generated from the OpenAI Platform and paste it into theConfigure OpenAI API Keydialog within theChatbotwindow in COMSOL Multiphysics. ClickOK.

You are now ready to use theChatbotwindow in the software.

A UI screenshot of the Model Builder where the Chatbot window is opened and a general conversation has been initiated. A UI screenshot of the Model Builder where the Chatbot window is opened and a general conversation has been initiated.

COMSOL Multiphysics with theChatbotwindow configured with an OpenAI API key. You can update or change the API key later from thePreferenceswindow.

Obtaining Your Corporate Account API Key

OpenAI

The following process is valid for scenarios where there is centralized management of the OpenAI Platform in your organization and you are supposed to be connected to a corporate account. For these cases, most steps should be performed by a manager of the corporate account; the other steps should be taken by a designated COMSOL Multiphysics user. The process listed below indicates who should perform each step. The first four steps are identical to that of when obtaining a personal account API key but should be performed by the manager.

  1. Register or Log In (manager)
    • Start by visiting theOpenAI Platform. Sign up, or log in if you already have an account. Note that OpenAI's API is a separate product from ChatGPT®. Registering for an account may require a valid phone number and email.
  2. Set Your Organization (manager)
    • Optionally, go to theSettingsmenu and under theOrganizationsection, set your organization profile according to the instructions provided by OpenAI. The provided name will be displayed in the upper-left corner of the OpenAI Platform web interface. For demonstration purposes, in the screenshots below the displayed organization name is COMSOL.
  3. Set Up Billing (manager)
    • The OpenAI API is a pay-as-you-go service. As a result, to use the chatbot tool within COMSOL Multiphysics you must add a valid payment method and top up your credit balance. To do this, go to theBillingsection under theSettingsmenuand follow the instructions provided.
The billing settings are shown after logging into an account on the OpenAI Platform web interface. The billing settings are shown after logging into an account on the OpenAI Platform web interface.

A screenshot of the OpenAI Platform web interface with theBillingsection of the settings opened. A valid payment method is added and the credit balance is recharged.

  1. Create New Project (manager)
    • Optionally, in the upper-left corner of the OpenAI Platform web interface, click on theProjectfield, which is next to the organization name. Select the+Create projectbutton and create a new project devoted to chatbot-related tasks. For demonstration purposes, in the screenshots below the custom project name is "for COMSOL".
A pop-up window that prompts you to enter a name to create a new project is shown on the OpenAI Platform web interface. A pop-up window that prompts you to enter a name to create a new project is shown on the OpenAI Platform web interface.

A screenshot of the OpenAI Platform web interface with the menu to create a new project opened.

  1. Invite Team Members (manager)
A pop-up window that prompts you to enter an email address and specify a role for team members you want to invite to the new project created on the OpenAI Platform web interface. A pop-up window that prompts you to enter an email address and specify a role for team members you want to invite to the new project created on the OpenAI Platform web interface.

A screenshot of the OpenAI Platform web interface with the dialog to invite a new team member to an organization.

  1. Accept Invite and Register or Log In (COMSOL Multiphysics user)
    • Accept the invitation sent by the corporate account manager to your email. In theOpenAI Platform, sign up, or log in if you already have an account. Note that OpenAI's API is a separate product from ChatGPT®. The registration may require a valid phone number and email.
  2. Add Members to Project (manager)
    • In the OpenAI Platform, select the project devoted to tasks related to COMSOL Multiphysics. Go toSettings, thenProject, and in theMemberssection, click the+Add Member Buttonoperation. Select an appropriate team member from the menu and click theAddbutton. Note that only the names of members who have already accepted an invitation and have an OpenAI Platform account are displayed. Choose an appropriate role following the instructions provided by OpenAI.
A pop-up window that prompts you to add team members to the new project created on the OpenAI Platform web interface. A pop-up window that prompts you to add team members to the new project created on the OpenAI Platform web interface.

A screenshot of the OpenAI Platform web interface with the dialog to add a new team member to a project.

  1. Generate the API Key (COMSOL Multiphysics user)
    • In the OpenAI Platform web interface, select your organization and the project you have been added to. Then, go to theDashboardmenu and select theAPI keyssection. Click the+Create new secret keybutton, and then click theCreate secret keyoption.
The OpenAI Platform web interface showing a pop-up window that prompts you to enter a name to generate a new secret API key. The OpenAI Platform web interface showing a pop-up window that prompts you to enter a name to generate a new secret API key.

A screenshot of the OpenAI Platform web interface with the menu to generate a new secret API key.

  1. Configure the API Key in COMSOL Multiphysics (COMSOL Multiphysics user)
    • Open a session of COMSOL Multiphysics. From theHomeribbon tab, under theWindowsbutton, selectChatbotto open theChatbotwindow. Copy the API key generated from the OpenAI Platform and paste it into theConfigure OpenAI API Keydialog within theChatbotwindow in COMSOL Multiphysics. ClickOK.

You are now ready to use theChatbotwindow in the software.

A UI screenshot of the Model Builder where the Chatbot window is opened and a programming conversation has been initiated. A UI screenshot of the Model Builder where the Chatbot window is opened and a programming conversation has been initiated.

COMSOL Multiphysics with theChatbotwindow configured and displaying part of a conversation. Here, the generated code can easily be sent to theJava Shellwindow, where it can be run to define a newAnalyticfunction node in the model tree.

Updating Your Chatbot Preferences in COMSOL Multiphysics®

In addition to using theConfigure OpenAI API Keydialog within theChatbotwindow in COMSOL Multiphysics, you can optionally also configure use of the chatbot by updating your preferences in the software. To do so, under theFilemenu, selectPreferences. From there, select theChatbotpage.

A UI screenshot of the Preferences window in COMSOL Multiphysics with the Chatbot category selected.

ThePreferenceswindow with the settings for the chatbot opened.

Additional options are available here, such as for enabling or disabling the chatbot tool, entering your API key, designating the AI model that the chatbot uses, and more. More information regarding thePreferencessettings is available in the documentation.

Further Learning

For more information about the chatbot tool, see the "Using a Chatbot" section of theReference Manualdocumentation. You can also refer to the Learning Center entry "Modeling with ChatGPT®" to gain practice in using the chatbot functionality in your modeling process. Note that the procedure outlined in that entry can be done within theChatbotwindow instead of needing to have both a session of COMSOL Multiphysics and a web browser open.

ChatGPT is a registered trademark of OpenAI, Inc.

Java is a registered trademark of Oracle and/or its affiliates.

Microsoft and Windows are trademarks of the Microsoft group of companies.


请提交与此页面相关的反馈,或点击此处联系技术支持

Baidu
map