System
A system using a server and terminal with a generative AI model addresses the complexity of software development by efficiently generating, optimizing, and debugging code, enhancing productivity and code quality.
Patent Information
- Application Number
- JP2024118247
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2026-02-04
AI Technical Summary
The software development process is becoming increasingly complex, leading to significant time and effort for bug fixes and code optimization, particularly affecting resource-limited companies like startups, resulting in delays and poor code quality.
A system utilizing a server and terminal interaction with a generative AI model to receive user inputs, generate code snippets, optimize code, and debug code, enabling efficient high-quality code generation, optimization, and debugging.
This system streamlines software development by allowing users to efficiently generate, optimize, and debug code, reducing development time and improving code quality.
Smart Images

Figure 2026017465000001_ABST
Abstract
Description
[Technical Field]
[0001] The technology of the present disclosure relates to a system. [Background technology]
[0002] Patent document 1 discloses a persona chatbot control method performed by at least one processor, the method including the steps of receiving a user utterance, adding the user utterance to a prompt including an instruction sentence related to a description of the chatbot character, encoding the prompt, and inputting the encoded prompt into a language model to generate a chatbot utterance in response to the user utterance. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Japanese Patent Publication No. 2022-180282 Summary of the Invention [Problem to be solved by the invention]
[0004] The software development process is becoming more complex every year, and bug fixes and code optimization require a significant amount of time and effort. This problem is particularly pronounced in resource-limited companies, such as startups, and can lead to delays in development time and poor code quality. There is a need to address these issues and provide a method for efficiently generating, optimizing, and debugging high-quality code. [Means for solving the problem]
[0005] The present invention solves the above-mentioned problems by providing a system including: means for receiving input from a user; means for sending the input prompt to a generative AI model and generating a code snippet; means for returning the generated code snippet to the user; means for sending prompts for optimizing the received code to a generative AI model and generating optimized code; means for returning the generated optimized code to the user; means for sending buggy code received from the user to a generative AI model and generating debugged code; and means for returning the generated debug code to the user. This system streamlines the software development process, enabling shorter development times and improved code quality.
[0006] "Means for receiving input from a user" refers to a device or software that has the function of receiving text or program code entered by a user.
[0007] "Means for sending the input prompt to the generative AI model and generating a code snippet" refers to a device or software that has the function of transmitting instructions input by a user to the generative AI model and generating a code snippet based on the instructions.
[0008] "Means for returning the generated code snippet to the user" refers to a device or software that has the function of returning the code snippet generated by the generative AI model to the user.
[0009] "Means for sending prompts to optimize the received code to the generative AI model and generating optimized code" refers to devices or software that have the function of conveying instructions to the generative AI model to make the code received from the user more efficient and generating optimized code.
[0010] "Means for returning the generated optimized code to the user" refers to a device or software that has the function of returning the optimized code generated by the generative AI model to the user.
[0011] "Means for transmitting buggy code received from a user to a generative AI model and generating debugged code" refers to a device or software that has the function of transmitting buggy code received from a user to a generative AI model and generating code with the bug fixed.
[0012] "Means for returning generated debug code to the user" refers to a device or software that has the function of returning debug code corrected by the generative AI model to the user.
[0013] A "code snippet generator" is a device or software that has the function of generating code snippets based on a specific programming language.
[0014] An "optimizer" is a device or software that has the ability to apply multiple code optimization techniques to improve program performance. [Brief explanation of the drawings]
[0015] [Figure 1] 1 is a conceptual diagram showing an example of the configuration of a data processing system according to a first embodiment. [Figure 2] 1 is a conceptual diagram showing an example of main functions of a data processing device and a smart device according to a first embodiment. [Figure 3] FIG. 10 is a conceptual diagram showing an example of the configuration of a data processing system according to a second embodiment. [Figure 4] FIG. 10 is a conceptual diagram showing an example of main functions of a data processing device and smart glasses according to a second embodiment. [Figure 5] FIG. 10 is a conceptual diagram showing an example of the configuration of a data processing system according to a third embodiment. [Figure 6] FIG. 11 is a conceptual diagram showing an example of main functions of a data processing device and a headset-type terminal according to a third embodiment. [Figure 7] FIG. 10 is a conceptual diagram showing an example of the configuration of a data processing system according to a fourth embodiment. [Figure 8]FIG. 10 is a conceptual diagram showing an example of main functions of a data processing device and a robot according to a fourth embodiment. [Figure 9] 1 shows an emotion map onto which multiple emotions are mapped. [Figure 10] 1 shows an emotion map onto which multiple emotions are mapped. [Figure 11] FIG. 3 is a sequence diagram showing a processing flow of the data processing system according to the first embodiment. [Figure 12] FIG. 10 is a sequence diagram showing the flow of processing in the data processing system in Application Example 1. [Figure 13] FIG. 10 is a sequence diagram showing the flow of processing in the data processing system according to the second embodiment when an emotion engine is combined. [Figure 14] FIG. 10 is a sequence diagram showing the flow of processing in the data processing system in Application Example 2 when an emotion engine is combined. DETAILED DESCRIPTION OF THE INVENTION
[0016] An example of an embodiment of a system according to the technology of the present disclosure will be described below with reference to the accompanying drawings.
[0017] First, the terms used in the following description will be explained.
[0018] In the following embodiments, a coded processor (hereinafter simply referred to as a "processor") may be a single arithmetic device or a combination of multiple arithmetic devices. Furthermore, a processor may be a single type of arithmetic device or a combination of multiple types of arithmetic devices. Examples of arithmetic devices include a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), a GPGPU (General-Purpose computing on Graphics Processing Units), and an APU (Accelerated Processing Unit).
[0019] In the following embodiments, a coded RAM (Random Access Memory) is a memory in which information is temporarily stored and is used as a working memory by a processor.
[0020] In the following embodiments, the coded storage is one or more non-volatile storage devices that store various programs, various parameters, etc. Examples of non-volatile storage devices include flash memory (SSD (Solid State Drive)), magnetic disks (e.g., hard disks), and magnetic tapes.
[0021] In the following embodiments, a communication I / F (Interface) with a symbol is an interface including a communication processor, an antenna, etc. The communication I / F controls communication between multiple computers. Examples of communication standards applied to the communication I / F include wireless communication standards including 5G (5th Generation Mobile Communication System), Wi-Fi (registered trademark), Bluetooth (registered trademark), etc.
[0022] In the following embodiments, "A and / or B" is synonymous with "at least one of A and B." In other words, "A and / or B" means that it may be only A, only B, or a combination of A and B. Furthermore, in this specification, the same concept as "A and / or B" is also applied when three or more things are expressed connected by "and / or."
[0023] [First embodiment]
[0024] FIG. 1 shows an example of the configuration of a data processing system 10 according to the first embodiment.
[0025] 1, a data processing system 10 includes a data processing device 12 and a smart device 14. An example of the data processing device 12 is a server.
[0026] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[0027] The smart device 14 includes a computer 36, a reception device 38, an output device 40, a camera 42, and a communication I / F 44. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The reception device 38, the output device 40, and the camera 42 are also connected to the bus 52.
[0028] The reception device 38 includes a touch panel 38A, a microphone 38B, and the like, and receives user input. The touch panel 38A detects contact with an indicator (for example, a pen or a finger) to receive user input by the touch of the indicator. The microphone 38B detects the user's voice to receive user input by voice. The control unit 46A transmits data indicating the user input received by the touch panel 38A and the microphone 38B to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the data indicating the user input.
[0029] The output device 40 includes a display 40A and a speaker 40B, and presents data to the user 20 by outputting the data in a form of expression that the user 20 can perceive (for example, audio and / or text). The display 40A displays visible information such as text and images in accordance with instructions from the processor 46. The speaker 40B outputs audio in accordance with instructions from the processor 46. The camera 42 is a compact digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor.
[0030] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 control the exchange of various information between the processor 46 and the processor 28 via the network 54.
[0031] FIG. 2 shows an example of the main functions of the data processing device 12 and the smart device 14.
[0032] 2, in the data processing device 12, a specific process is performed by the processor 28. A specific processing program 56 is stored in the storage 32. The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific process is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.
[0033] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.
[0034] In the smart device 14, the processor 46 performs the reception output process. The storage 50 stores a reception output program 60. The reception output program 60 is used in conjunction with the specific processing program 56 by the data processing system 10. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.
[0035] Next, a description will be given of the specific processing performed by the specific processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0036] The present invention is a system that generates code snippets based on prompts entered by a user, and further optimizes and debugs the received code. The system is mainly realized through the interaction of a server, a terminal, and a user.
[0037] System Configuration
[0038] 1. Terminal
[0039] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[0040] 2. Server
[0041] The server is a multi-function computer system that works in conjunction with generative AI models to perform prompt-based code generation, optimization, and debugging.
[0042] 3. Users
[0043] Users are developers who operate the system and want to generate, optimize, and debug code.
[0044] Program Description
[0045] Generate code snippets
[0046] When a user wants to generate a code snippet in a particular programming language, they enter a prompt into the terminal, such as "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server receives the prompt and sends a request to the generative AI model. The generative AI model generates a code snippet based on the prompt and sends it back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[0047] Code optimization
[0048] When a user wants to optimize existing code, they input the original code into their device. This optimization request is sent to the server, which then asks a generative AI model to optimize the code. The generative AI model analyzes the code, performs optimizations to improve performance, and sends the result back to the server. The server then sends the optimized code back to the device, which displays it to the user.
[0049] Debugging bugs
[0050] When a user wants to debug a buggy piece of code, they input the code into their device. The device then sends a debug request to the server. The server then asks the generative AI model to fix the bug, which then analyzes the code and fixes the bug. The corrected code is sent back to the server, which then sends it back to the device. Finally, the device displays the corrected debug code to the user.
[0051] Specific examples
[0052] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[0053] 1. The user types a prompt into the terminal.
[0054] 2. The terminal sends a prompt to the server.
[0055] 3. The server sends a request to the generative AI model to generate a code snippet.
[0056] 4. The server sends the generated code back to the device.
[0057] 5. The terminal displays the code snippet to the user.
[0058] A similar process is used for optimizing and debugging code. For example, if a user inputs code, such as "Please optimize the following code," the server sends the request to the generative AI model, which generates the optimized code and sends it back to the device, which then displays it to the user. Similarly, when debugging bugs, the server sends the buggy code to the generative AI model and requests a fix, after which the fixed code is provided to the user via the device.
[0059] This allows users to efficiently generate, optimize, and debug high-quality code.
[0060] The processing flow will be explained below.
[0061] Generate code snippets
[0062] Step 1:
[0063] If a user wants to generate a code snippet in a particular programming language, they type a prompt into the terminal, for example, "Implement a binary search algorithm in Python."
[0064] Step 2:
[0065] The terminal receives the user's input and sends the prompts to the server.
[0066] Step 3:
[0067] The server parses the received prompt and sends a request to the generative AI model, which includes the prompt content and requirements for the code to be generated.
[0068] Step 4:
[0069] The generative AI model generates the appropriate code snippet based on the prompts received and sends the results back to the server.
[0070] Step 5:
[0071] The server receives the generated code snippet and sends it back to the device.
[0072] Step 6:
[0073] The terminal displays the generated code received from the server to the user.
[0074] Code optimization
[0075] Step 1:
[0076] If a user wants to optimize existing code, they input the original code they want to optimize into the terminal, for example, the code for a binary search algorithm.
[0077] Step 2:
[0078] The terminal receives the user's input and sends the optimization request to the server.
[0079] Step 3:
[0080] The server analyzes the received original code and sends an optimization request to the generative AI model, which includes the content of the original code and instructions for optimization.
[0081] Step 4:
[0082] Based on the original code it receives, the generative AI model generates optimized code that improves performance and efficiency, and sends the results back to the server.
[0083] Step 5:
[0084] The server receives the generated optimized code and returns it to the terminal.
[0085] Step 6:
[0086] The terminal displays the optimization code received from the server to the user.
[0087] Debugging bugs
[0088] Step 1:
[0089] If a user wants to debug buggy code, they enter the buggy code into the terminal, for example, a buggy version of the binary search algorithm mentioned above.
[0090] Step 2:
[0091] The terminal receives the user's input and sends the debug request to the server.
[0092] Step 3:
[0093] The server analyzes the received buggy code and sends a debug request to the generative AI model, which includes the contents of the buggy code and instructions for debugging.
[0094] Step 4:
[0095] Based on the buggy code it receives, the generative AI model generates debugged code that fixes the bug and sends the results back to the server.
[0096] Step 5:
[0097] The server receives the generated debug code and sends it back to the device.
[0098] Step 6:
[0099] The terminal displays the debugged code received from the server to the user.
[0100] These steps allow the user to efficiently generate, optimize, and debug code.
[0101] Example 1
[0102] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0103] Conventional systems make it difficult for users to efficiently generate, optimize, and debug program code. In particular, there were issues with the quality of the generated code, the accuracy of optimization, and the accuracy of bug fixes. Furthermore, there was no system that automatically executed corresponding actions based on the prompts and code entered by the user, providing quick results. This could result in reduced developer productivity, leading to project delays and a decline in quality.
[0104] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.
[0105] In this invention, the server includes: [means for receiving input from a user]; [means for sending the entered prompt to a generative AI model and generating a code snippet]; [means for returning the generated code snippet to the user]; [means for sending a prompt for optimizing the received code to a generative AI model and generating optimized code]; [means for returning the generated optimized code to the user]; [means for sending buggy code received from the user to a generative AI model and generating debugged code]; [means for returning the generated debug code to the user]; and [means for displaying the code snippet, optimized code, and debug code generated by the generative AI model. This enables users to efficiently generate, optimize, and debug high-quality code.
[0106] "Users" are the people who operate the system and provide input, and developers who request code generation, optimization, and debugging.
[0107] A "terminal" is a device operated by a user, which accepts and displays input and sends requests to a server.
[0108] The "server" is a computer system that works in conjunction with the generative AI model to generate, optimize, and debug code based on prompts.
[0109] A "prompt" is an instruction that a user enters to request a particular action from the system, such as "Please implement a binary search algorithm in Python."
[0110] A "generative AI model" is an artificial intelligence model that generates code snippets based on user-entered prompts and also optimizes and debugs the received code.
[0111] "Code snippet generation means" refers to a function on the server that sends a prompt to a generation AI model and generates a code snippet.
[0112] "Optimization means" refers to a function that sends prompts to the generative AI model to optimize the code received at the server, and generates optimized code.
[0113] "Debugging means" refers to a function that sends buggy code received from a user to a generation AI model on the server and generates debugged code.
[0114] "Display means" refers to a function that displays to the user the code snippets, optimized code, and debugged code generated by the generative AI model.
[0115] The present invention is a system for generating code snippets based on user prompts, and optimizing and debugging the received code. This system is implemented primarily through the interaction of a server, a terminal, and a user.
[0116] System Configuration
[0117] 1. Terminal
[0118] A terminal is a device operated by a user that accepts input, displays, and transmits requests. A user enters prompts or codes through a terminal. For example, devices that can be used as terminals include PCs, tablets, and smartphones.
[0119] 2. Server
[0120] The server is a multi-function computer system that works in conjunction with a generative AI model, such as the well-known GPT-4, to generate code based on prompts, optimize it, and debug it.
[0121] 3. Users
[0122] The user is a developer who operates the system and wants to generate, optimize, and debug code. The user uses a terminal to enter prompts.
[0123] Program Description
[0124] Generate code snippets
[0125] First, when a user wants to generate a code snippet in a specific programming language, they enter a prompt into the terminal. This prompt might be something like "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server receives the prompt and sends a request to the generative AI model. The generative AI model generates a code snippet based on the prompt and sends it back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[0126] Specific examples
[0127] For example, a user types the prompt "Implement a binary search algorithm in Python" into a terminal. The terminal sends this prompt to a server, which then makes a request to a generative AI model. The generative AI model generates a code snippet and sends it back to the server. The server sends the code snippet to the terminal, which displays it to the user.
[0128] Code optimization
[0129] When a user wants to optimize existing code, they input the original code into their device. This optimization request is sent to the server, which then asks a generative AI model to optimize the code. The generative AI model analyzes the code, performs optimizations to improve performance, and sends the result back to the server. The server then sends the optimized code back to the device, which displays it to the user.
[0130] Specific examples
[0131] If a user types in code like "Please optimize the following Python code," the device sends the request and code to the server, which sends the request to a generative AI model, which generates the optimized code and sends it back to the device, which then displays it to the user.
[0132] Debugging bugs
[0133] When a user wants to debug a buggy piece of code, they input the code into their device. The device then sends a debug request to the server. The server then asks the generative AI model to fix the bug, which then analyzes the code and fixes the bug. The corrected code is sent back to the server, which then sends it back to the device. Finally, the device displays the corrected debug code to the user.
[0134] Specific examples
[0135] If a user inputs a buggy code such as "Please fix the bug in the Python code below," the device sends the request and the code to the server, which sends the request to the generative AI model, which generates the corrected code and sends it back to the device, which displays it to the user.
[0136] The above process allows users to efficiently generate, optimize, and debug high-quality code. This system is realized through the cooperation of servers, terminals, and generative AI models.
[0137] The flow of the identification process in the first embodiment will be described with reference to FIG.
[0138] Program processing flow
[0139] Generate code snippets
[0140] Step 1:
[0141] The user enters a prompt into the terminal. The user enters a prompt sentence such as "Implement a binary search algorithm in Python" into the input field of the terminal. This prepares the terminal to send the prompt sentence to the system.
[0142] Step 2:
[0143] The terminal receives the input prompt text and sends it to the server. Specifically, the terminal sends the prompt text as an HTTP request to the server's API endpoint. Input: Prompt text. Output: Request to the server.
[0144] Step 3:
[0145] The server receives the prompt and forwards it to the generative AI model. The server's internal logic parses the prompt and sends a request to the generative AI model. Input: Prompt. Output: Request to the generative AI model.
[0146] Step 4:
[0147] The generative AI model generates a code snippet based on the received prompt. The generative AI model analyzes the prompt and runs an algorithm to generate the appropriate code. Input: Prompt. Output: Generated code snippet.
[0148] Step 5:
[0149] The server returns the code snippet received from the generative AI model to the device. The server receives the response from the generative AI model and sends it to the device as an HTTP response. Input: Generated code snippet. Output: Response to the device.
[0150] Step 6:
[0151] The terminal displays the generated code snippet to the user. Specifically, the terminal's user interface displays this code in a text area. Input: Generated code snippet. Output: Displayed to the user.
[0152] Code optimization
[0153] Step 1:
[0154] The user inputs the code they want to optimize and their request into the terminal. The user inputs "Please optimize this Python code" and the original code. Input: Optimization request and original code.
[0155] Step 2:
[0156] The device sends the request and original code to the server. The device sends this data to the server as an HTTP request. Input: Optimized request, original code. Output: Request to the server.
[0157] Step 3:
[0158] The server receives the optimization request and the original code and forwards them to the generative AI model. The server sends the received data to the generative AI model in the appropriate format. Input: Optimization request, original code. Output: Request to the generative AI model.
[0159] Step 4:
[0160] A generative AI model analyzes the original code and generates optimized code. The generative AI model applies optimization algorithms to improve performance. Input: Optimization request, original code. Output: Optimized code.
[0161] Step 5:
[0162] The server returns the optimized code received from the generative AI model to the device. The server receives the response from the generative AI model and sends it to the device as an HTTP response. Input: Optimized code. Output: Response to the device.
[0163] Step 6:
[0164] The terminal displays the optimized code to the user. The terminal's user interface displays this optimized code. Input: Optimized code. Output: Display to user.
[0165] Debugging bugs
[0166] Step 1:
[0167] User types buggy code and a debug request into the terminal. User types "Please fix the bug in this Python code" and the buggy code. Input: Debug request and buggy code.
[0168] Step 2:
[0169] The device sends the request and the buggy code to the server. The device sends this data to the server as an HTTP request. Input: Debug request, buggy code. Output: Request to the server.
[0170] Step 3:
[0171] The server receives the debug request and the buggy code and forwards them to the generative AI model. The server sends the received data to the generative AI model in the appropriate format. Input: Debug request, buggy code. Output: Request to the generative AI model.
[0172] Step 4:
[0173] A generative AI model analyzes buggy code and fixes the bug. A generative AI model analyzes the cause of the bug and applies a fix algorithm. Input: Debug request, buggy code. Output: Fixed code.
[0174] Step 5:
[0175] The server returns the corrected code received from the generative AI model to the device. The server receives the response from the generative AI model and sends it to the device as an HTTP response. Input: Corrected code. Output: Response to the device.
[0176] Step 6:
[0177] The terminal displays the modified code to the user. The terminal's user interface displays this modified code. Input: Modified code. Output: Display to user.
[0178] (Application example 1)
[0179] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0180] In conventional factory robot systems, the code required for maintenance and operation is generated, optimized, and debugged manually, resulting in problems of inefficiency and inaccuracy. Furthermore, because the robots themselves lack the ability to perform maintenance tasks autonomously, they face challenges such as high operating costs and long downtime. These issues reduce factory productivity and operational efficiency, undermining competitiveness.
[0181] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.
[0182] In this invention, the server includes means for receiving input from a user, means for sending the input prompt to a generative AI model and generating a code snippet, means for returning the generated code snippet to the user, means for sending a prompt to optimize the received code to the generative AI model and generating optimized code, means for returning the generated optimized code to the user, means for sending buggy code received from the user to the generative AI model and generating debugged code, means for returning the generated debug code to the user, means for generating maintenance work code to assist in robot operation, means for applying the generated maintenance work code to the robot's operation system, and means for optimizing and debugging the code using data from sensors and actuators. This enables the robot to autonomously perform high-quality maintenance work and be operated efficiently.
[0183] "Users" are developers and operators who interact with the system and want to generate, optimize, and debug code.
[0184] A means for receiving "input" is a device or interface through which a user enters prompts or codes, and has the ability to transmit these to the system.
[0185] A "prompt" is a textual input that a user uses to instruct a generative AI model, including instructions for generating a specific code snippet.
[0186] A "generative AI model" is an artificial intelligence model that uses natural language processing techniques to generate code or other output based on prompts.
[0187] A "code snippet" is a portion of program code that is generated to perform a particular task.
[0188] "Optimization" refers to techniques and techniques for improving the performance and efficiency of existing code.
[0189] "Debugging" is a technique for detecting and correcting bugs and errors in existing code.
[0190] A "robot" is a device that operates in a factory and automates manufacturing and maintenance tasks.
[0191] "Maintenance work" refers to calibration, repair, and adjustment work carried out to maintain the performance and lifespan of the robot.
[0192] "Operation system" is a collective term for the hardware and software that controls a robot and allows it to perform specific tasks.
[0193] "Sensor and actuator data" refers to operational data collected from the robot's various sensors (temperature, pressure, position, etc.) and actuators.
[0194] The present invention is a system that generates code snippets based on user-entered prompts, and optimizes and debugs the received code. This system is mainly realized through the interaction of a server, a terminal, and a user.
[0195] System Configuration
[0196] 1. Terminal
[0197] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[0198] 2. Server
[0199] The server performs processing using the following hardware and software.
[0200] Hardware: Cloud or on-premise servers
[0201] software:
[0202] Generative AI models: e.g., GPT-3 and GPT-4
[0203] Data communication: API requests using the HTTP protocol
[0204] The server works with the generative AI model to generate, optimize, and debug code based on prompts, and also generates dedicated maintenance work code and applies it to the robot.
[0205] 3. Users
[0206] Users are developers and operators who operate the system and want to generate, optimize, and debug code.
[0207] Operational procedures and application examples
[0208] Generate code snippets
[0209] When a user wants to generate a code snippet for a specific maintenance task, they enter a prompt into the device, such as "Generate code to calibrate an infrared sensor in Python." The device then sends this prompt to the server, and a generative AI model generates the code snippet based on the prompt.
[0210] Code optimization
[0211] When a user wants to optimize existing maintenance code, they input the original code into the device, for example, in the form of "Please optimize the following code." The device then sends this request to the server, where a generative AI model analyzes the code and performs optimizations to improve performance.
[0212] Debugging bugs
[0213] When a user wants to debug a buggy source code, they input the code into the device, which then sends a debug request to the server, where the generative AI model analyzes the code and fixes the bug.
[0214] Generate and apply maintenance work codes
[0215] To enable the robot to perform self-maintenance, code is generated using a dedicated prompt. For example, enter a prompt such as "Generate code to calibrate the infrared sensor in Python." The generated code is applied to the robot's operating system, allowing it to perform maintenance tasks autonomously.
[0216] By configuring the system in this way and using various hardware and software appropriately, users can efficiently generate, optimize, and debug high-quality code. Furthermore, the robot can autonomously perform maintenance tasks, which is expected to improve operational efficiency.
[0217] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[0218] Step 1:
[0219] The user inputs a prompt into the terminal. Specifically, the user inputs a prompt such as "Please generate code to calibrate the infrared sensor using Python." The input prompt is processed as text data within the terminal.
[0220] Step 2:
[0221] The device sends the prompt entered by the user to the server. Data is transmitted using the HTTP protocol, and the prompt is sent to the server in JSON format. The input data is a prompt sentence, and this data is converted into a request to be sent to the generative AI model.
[0222] Step 3:
[0223] The server sends the received prompt to the generative AI model. The server parses the prompt and sends it as an API request to the generative AI model. The server asks the model to generate a code snippet based on the prompt.
[0224] Step 4:
[0225] The generative AI model generates code snippets based on the prompt. Specifically, the generative AI model uses natural language processing techniques to analyze the prompt and generate the corresponding code snippet. This generation process takes the prompt as data input and provides Python code as text output.
[0226] Step 5:
[0227] The server receives the code snippet returned by the generative AI model and sends it to the device. The code snippet generated on the server is reformatted as text data and sent to the device as an HTTP response.
[0228] Step 6:
[0229] The terminal displays the code snippet received from the server to the user. The terminal parses the data received as an HTTP response and displays the generated code to the user through an appropriate GUI, allowing the user to review the generated code and proceed to the next step if necessary.
[0230] Step 7:
[0231] When a user wants to optimize existing code, they input the original code into the terminal. The user inputs a request such as "Please optimize the following code" and includes the code to be optimized. This input data is used for the next optimization process.
[0232] Step 8:
[0233] The device sends an optimization request to the server. The original code received from the user is sent to the server in JSON format as an optimization request.
[0234] Step 9:
[0235] The server requests the generative AI model to optimize the code. The server sends the received code to the generative AI model and requests the generative AI model to perform optimizations to improve performance.
[0236] Step 10:
[0237] A generative AI model analyzes the code and generates optimized code. The generative AI model uses multiple optimization techniques to improve the performance of the code. The input data is the original code, and the output data is optimized code.
[0238] Step 11:
[0239] The server sends the optimized code to the device, where it is reformatted as text data and sent as an HTTP response to the device.
[0240] Step 12:
[0241] The terminal displays the optimized code received from the server to the user. The terminal analyzes the data received as an HTTP response and displays the optimized code to the user through an appropriate GUI, allowing the user to review the optimized code and proceed to the next step.
[0242] Furthermore, an emotion engine that estimates the user's emotion may be combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59 and perform identification processing using the user's emotion.
[0243] The present invention provides a system for generating code snippets based on user-entered prompts, and optimizing and debugging the received code. Furthermore, the system's effectiveness is enhanced by incorporating an emotion engine that recognizes the user's emotions and adjusts the generated code and prompts accordingly. The system is specifically implemented as follows:
[0244] System Configuration
[0245] 1. Terminal
[0246] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[0247] 2. Server
[0248] The server is a multi-functional computer system that works with generative AI models to generate, optimize, and debug code based on prompts, and also includes an emotion engine that recognizes user emotions and reflects them in the code generation process.
[0249] 3. Emotion Engine
[0250] The emotion engine analyzes emotions based on user input and other user data, and adjusts the code and optimization prompts output by the generative AI model, reducing user stress and providing a better development experience.
[0251] 4. Users
[0252] Users are developers who operate the system and want to generate, optimize, and debug code.
[0253] Program Description
[0254] Generate code snippets
[0255] When a user wants to generate a code snippet in a specific programming language, they enter a prompt into the terminal, for example, "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server uses an emotion engine to analyze the user's emotion and sends a request to the generative AI model. This request includes the prompt content and adjustments based on the user's emotion. The generative AI model generates a code snippet based on the prompt and sends the result back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[0256] Code optimization
[0257] When a user wants to optimize existing code, they input the original code into the device. For example, they input the code for a binary search algorithm. The device then sends this optimization request to the server. The server uses an emotion engine to analyze the user's emotions and adjusts the optimization prompt based on those emotions. The server then sends the code along with the prompt to a generative AI model, which generates optimized code. The result is then sent back to the server, which then sends the optimized code back to the device, which then displays it to the user.
[0258] Debugging bugs
[0259] If a user wants to debug buggy code, they enter the buggy code into their device—for example, a buggy version of the binary search algorithm mentioned above. The device then sends this debug request to the server. The server uses an emotion engine to analyze the user's emotion and tailors the debug prompt based on that emotion. It then sends the code along with the prompt to a generative AI model, which generates debugged code. The result is then sent back to the server, which then sends the debugged code back to the device, which displays it to the user.
[0260] Specific examples
[0261] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[0262] 1. The user types a prompt into the terminal.
[0263] 2. The terminal sends a prompt to the server.
[0264] 3. The server analyzes the user's emotions using an emotion engine and sends a request to a generative AI model to generate a code snippet.
[0265] 4. The server sends the generated code back to the device.
[0266] 5. The terminal displays the code snippet to the user.
[0267] Optimization and debugging are also performed in a similar manner based on user emotions. For example, if a user enters code saying, "Please optimize the following code," the server analyzes the emotion through the emotion engine and sends an optimization prompt to the generative AI model. The generative AI model then generates optimized code, sends it back to the device via the server, and is ultimately displayed to the user. Bug fixes are also adjusted by the emotion engine, improving user satisfaction.
[0268] This allows users to generate, optimize, and debug code efficiently and with empathy in mind.
[0269] The processing flow will be explained below.
[0270] Generate code snippets
[0271] Step 1:
[0272] A user types a prompt into a terminal indicating that they would like to generate a code snippet in a specific programming language, for example, "Implement a binary search algorithm in Python."
[0273] Step 2:
[0274] The terminal sends this prompt to the server.
[0275] Step 3:
[0276] The server receives the prompt and passes the prompt and user information to the emotion engine to analyze the emotion.
[0277] Step 4:
[0278] The emotion engine analyzes the user's emotions and sends the results back to the server. For example, if the user is feeling stressed, it will return that information.
[0279] Step 5:
[0280] The server adjusts the prompts based on the analysis results of the emotion engine and sends them to the generative AI model.
[0281] Step 6:
[0282] The generative AI model generates code snippets based on the prompts and sends the results back to the server.
[0283] Step 7:
[0284] The server sends the generated code snippet back to the device.
[0285] Step 8:
[0286] The terminal displays the generated code received from the server to the user.
[0287] Code optimization
[0288] Step 1:
[0289] The user enters the original code into the terminal along with a request to optimize the existing code, for example, the code for a binary search algorithm.
[0290] Step 2:
[0291] The device sends this optimization request to the server.
[0292] Step 3:
[0293] The server receives the request and passes the original code and user information to the emotion engine to analyze the emotion.
[0294] Step 4:
[0295] The emotion engine analyzes the user's emotions and sends the results back to the server. For example, if the user is feeling anxious, it will return that information.
[0296] Step 5:
[0297] The server adjusts the optimization prompt based on the analysis results of the emotion engine and sends it to the generative AI model.
[0298] Step 6:
[0299] The generative AI model generates optimized code to improve performance based on the optimization prompts and sends the results back to the server.
[0300] Step 7:
[0301] The server returns the generated optimized code to the terminal.
[0302] Step 8:
[0303] The terminal displays the optimization code received from the server to the user.
[0304] Debugging bugs
[0305] Step 1:
[0306] A user enters buggy code into a terminal along with a request to debug the code, for example, a buggy version of a binary search algorithm.
[0307] Step 2:
[0308] The device sends this debug request to the server.
[0309] Step 3:
[0310] The server receives the request and passes the buggy code and user information to the emotion engine to analyze the emotion.
[0311] Step 4:
[0312] The emotion engine analyzes the user's emotions and sends the results back to the server. For example, if the user is irritated, it will return that information.
[0313] Step 5:
[0314] The server adjusts the debug prompt based on the analysis results of the emotion engine and sends it to the generative AI model.
[0315] Step 6:
[0316] The generative AI model generates code that fixes the bug based on the debug prompts and sends the results back to the server.
[0317] Step 7:
[0318] The server sends the generated debug code back to the device.
[0319] Step 8:
[0320] The terminal displays the debug code received from the server to the user.
[0321] These steps allow users to generate, optimize, and debug code efficiently and with emotion in mind.
[0322] Example 2
[0323] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0324] In conventional code generation systems, users input prompts and the generated code is not always optimized for the user's emotions or situation, which often leads to stress and dissatisfaction. Furthermore, code optimization and debugging must be done manually, making the development process inefficient. As a result, developer productivity is reduced.
[0325] The specific processing by the specific processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means.
[0326] In this invention, the server includes: [means for receiving input from a user; [means for sending the entered prompt to a generative AI model and generating a code snippet; [means for returning the generated code snippet to the user;] [means for sending a prompt for optimizing the received code to a generative AI model and generating optimized code; [means for returning the generated optimized code to the user;] [means for sending buggy code received from the user to a generative AI model and generating debugged code; [means for returning the generated debug code to the user; and] means for analyzing the user's emotions using an emotion engine and adjusting the prompts and generated code based thereon. This makes it possible [to generate, optimize, and debug code according to the user's emotions and needs].
[0327] "User" refers to the developer or programmer who operates the system and requests code generation, optimization, and debugging.
[0328] A "terminal" is a device operated by a user, such as a computer or mobile device, that accepts input, sends requests, and displays results.
[0329] "Server" refers to a high-performance computer system for running the generative AI model and emotion engine, as well as receiving prompts, emotion analysis, code generation, optimization, and debugging.
[0330] A "prompt" is an instruction or request that a user enters into the system, such as a request for code generation, optimization, or debugging.
[0331] "Code snippet" refers to a portion of a program generated by a generative AI model.
[0332] "Generative AI model" refers to an artificial intelligence model used to generate, optimize, and debug code based on user prompts.
[0333] An "emotion engine" refers to a technology that analyzes emotions based on user input and past interactions and reflects the results in a generative AI model.
[0334] "Optimization" refers to the process of making existing code more efficient and performant.
[0335] "Debugging" refers to the process of fixing buggy code so that it works properly.
[0336] The present invention is a system that generates code snippets based on user-entered prompts, and then optimizes and debugs the received code. Furthermore, the system incorporates an emotion engine that recognizes the user's emotions and adjusts the generated code and prompts accordingly, enhancing its effectiveness. The system of the present invention consists of several key components:
[0337] System Components
[0338] 1. Users
[0339] The user is a developer who operates the system and wants to generate code, optimize, and debug it. The user enters prompts and code into a terminal and receives the results.
[0340] 2. Terminal
[0341] A terminal is a device operated by a user that accepts input, displays, and sends requests. Users enter prompts and codes through the terminal. The terminal can be a PC, smartphone, tablet, etc.
[0342] 3. Server
[0343] The server is a multi-functional computer system that works with the generative AI model to generate, optimize, and debug code based on prompts. It also has an emotion engine that recognizes user emotions and reflects them in the code generation process. Specifically, it uses a natural language generation engine (e.g., GPT-3) as the generative AI model and EmotionAPI or similar for the emotion engine.
[0344] 4. Generative AI Models
[0345] Generative AI models are natural language generation engines used to generate, optimize, and debug code based on user prompts, with GPT-3 being an example use case.
[0346] 5. Emotion Engine
[0347] The emotion engine is a technology that analyzes emotions based on user input and past interactions and reflects the results in generative AI models. It uses EmotionAPI to analyze user emotions.
[0348] Explanation of program processing
[0349] Generate code snippets
[0350] When a user wants to generate a code snippet in a specific programming language, they enter a prompt into their device: "Implement a binary search algorithm in Python." The device then sends this prompt to the server. The server uses an emotion engine to analyze the user's emotion and sends the analysis result and the prompt to the generative AI model. The generative AI model uses this information to generate a code snippet and sends it back to the server. The server then sends the generated code snippet back to the device, which then displays it to the user.
[0351] Code optimization
[0352] When a user wants to optimize existing code, they input the original code into their device. For example, they input the code for a binary search algorithm. The device then sends this optimization request to the server. The server uses an emotion engine to analyze the user's emotions and sends the analysis results and the original code as an optimization prompt to the generative AI model. The generative AI model generates optimized code and sends it back to the server. The server then sends the optimized code back to the device, which displays it to the user.
[0353] Debugging bugs
[0354] When a user wants to debug buggy code, they input the buggy code into their device. For example, they input the code for a buggy binary search algorithm. The device then sends this debug request to the server. The server uses an emotion engine to analyze the user's emotions and sends the analysis result and the buggy code as a debug prompt to the generative AI model. The generative AI model generates debugged code and sends it back to the server. The server then sends the debugged code back to the device, which then displays it to the user.
[0355] Specific examples
[0356] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[0357] 1. The user types a prompt into the terminal.
[0358] 2. The terminal sends a prompt to the server.
[0359] 3. The server analyzes the user's emotions using an emotion engine and sends a request to a generative AI model to generate a code snippet.
[0360] 4. The server sends the generated code snippet back to the device.
[0361] 5. The terminal displays the code snippet to the user.
[0362] Optimization and debugging are also performed in a similar manner based on user emotions. For example, if a user enters code saying, "Please optimize the following code," the server analyzes the emotion through the emotion engine and sends an optimization prompt to the generative AI model. The generative AI model then generates optimized code, sends it back to the device via the server, and is ultimately displayed to the user. Bug fixes are also adjusted by the emotion engine, improving user satisfaction.
[0363] As described above, the present invention allows users to generate, optimize, and debug code efficiently while taking emotions into account.
[0364] The flow of the identification process in the second embodiment will be described with reference to FIG.
[0365] Generate code snippets
[0366] Step 1:
[0367] If a user wants to generate a code snippet in a specific programming language, they can type the prompt "Implement a binary search algorithm in Python" into the terminal.
[0368] Input: Prompt statement "Implement a binary search algorithm in Python"
[0369] Output: The prompt the user types into the terminal
[0370] Step 2:
[0371] The terminal sends the entered prompt to the server.
[0372] Input: The prompt received from the user
[0373] Data processing: Convert the prompt text into a format that can be sent to the server as an HTTP request
[0374] Output: Prompt text sent to the server
[0375] Step 3:
[0376] The server uses an emotion engine to analyze the user's emotions.
[0377] Input: The prompt sent to the server and the user's previous input data
[0378] Data calculation: Sentiment analysis using sentiment analysis tools such as EmotionAPI
[0379] Output: Sentiment analysis results (e.g., stress level, satisfaction, etc.)
[0380] Step 4:
[0381] The server sends the emotion analysis results and prompt sentence as a request to the generative AI model.
[0382] Input: prompt and sentiment analysis results
[0383] Data processing: shaping data into a format that can be fed into a generative AI model
[0384] Output: The request sent to the generative AI model
[0385] Step 5:
[0386] The generative AI model generates a code snippet based on the prompt text and sentiment analysis results and sends it back to the server.
[0387] Input: The request sent by the server
[0388] Data Calculation: Code generation based on prompt sentences and sentiment analysis results
[0389] Output: Generated code snippet
[0390] Step 6:
[0391] The server sends the generated code snippet back to the device.
[0392] Input: Code snippet received from the generative AI model
[0393] Data processing: Converting data into a format that can be sent back to the device as an HTTP response
[0394] Output: Code snippet sent to the terminal
[0395] Step 7:
[0396] The terminal displays the code snippet to the user.
[0397] Input: Code snippet received from the server
[0398] Data processing: Display in a visually understandable format for users
[0399] Output: The code snippet displayed to the user
[0400] Code optimization
[0401] Step 1:
[0402] The user enters into the terminal the existing code they wish to optimize, for example the code for a binary search algorithm.
[0403] Input: Original code
[0404] Output: The original code that the user entered into the terminal
[0405] Step 2:
[0406] The device sends an optimization request to the server.
[0407] Input: The code received from the user
[0408] Data processing: Converting data into a format to be sent to the server as an HTTP request
[0409] Output: The code sent to the server
[0410] Step 3:
[0411] The server uses an emotion engine to analyze the user's emotions.
[0412] Input: The code sent to the server and any previous inputs from the user
[0413] Data calculation: Sentiment analysis using sentiment analysis tools such as EmotionAPI
[0414] Output: Emotion analysis results
[0415] Step 4:
[0416] The server sends the sentiment analysis results and the original code as a request to the generated AI model.
[0417] Input: Original code and sentiment analysis results
[0418] Data processing: shaping data into a format that can be fed into a generative AI model
[0419] Output: The request sent to the generative AI model
[0420] Step 5:
[0421] The generative AI model generates optimized code based on the original code and sends it back to the server.
[0422] Input: The request sent by the server
[0423] Data calculation: Optimization process based on the original code and sentiment analysis results
[0424] Output: Optimized code
[0425] Step 6:
[0426] The server sends the optimized code back to the device.
[0427] Input: Optimized code received from a generative AI model
[0428] Data processing: Converting data into a format that can be sent back to the device as an HTTP response
[0429] Output: Optimized code sent to the terminal
[0430] Step 7:
[0431] The terminal displays the optimized code to the user.
[0432] Input: Optimized code received from the server
[0433] Data processing: Display in a visually understandable format for users
[0434] Output: The optimized code displayed to the user
[0435] Debugging bugs
[0436] Step 1:
[0437] The user types into the terminal the buggy code they want to debug, for example the code for a buggy binary search algorithm.
[0438] Input: Buggy code
[0439] Output: The buggy code as entered by the user into the terminal
[0440] Step 2:
[0441] The device sends a debug request to the server.
[0442] Input: Buggy code received from the user
[0443] Data processing: Converting data into a format to be sent to the server as an HTTP request
[0444] Output: The buggy code sent to the server
[0445] Step 3:
[0446] The server uses an emotion engine to analyze the user's emotions.
[0447] Input: The buggy code sent to the server and the user's previous input data
[0448] Data calculation: Sentiment analysis using sentiment analysis tools such as EmotionAPI
[0449] Output: Emotion analysis results
[0450] Step 4:
[0451] The server sends the sentiment analysis results and the buggy code as a request to the generated AI model.
[0452] Input: Buggy code and sentiment analysis results
[0453] Data processing: shaping data into a format that can be fed into a generative AI model
[0454] Output: The request sent to the generative AI model
[0455] Step 5:
[0456] The generative AI model generates debugged code based on the buggy code and sends it back to the server.
[0457] Input: The request sent by the server
[0458] Data calculation: Debugging process based on buggy code and sentiment analysis results
[0459] Output: Debugged code
[0460] Step 6:
[0461] The server sends the debugged code back to the device.
[0462] Input: Debugged code received from the generative AI model
[0463] Data processing: Converting data into a format that can be sent back to the device as an HTTP response
[0464] Output: Debugged code sent to the terminal
[0465] Step 7:
[0466] The terminal displays the debugged code to the user.
[0467] Input: The debugged code received from the server
[0468] Data processing: Display in a visually understandable format for users
[0469] Output: The debugged code displayed to the user
[0470] (Application example 2)
[0471] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart device 14 will be referred to as a "terminal."
[0472] Managing robot operations efficiently and safely is a key challenge for factory robot control systems. However, currently, generating, optimizing, and debugging robot program code requires a significant amount of time and expertise. In particular, when a problem occurs in the robot's control code, it is difficult to quickly debug it, significantly impacting productivity. Furthermore, the emotional state of the operator can lead to stress and reduced work efficiency. To address these issues, a system is needed that takes into account the operator's emotions while automating robot program code management.
[0473] The specific processing by the specific processing unit 290 of the data processing device 12 in Application Example 2 is realized by the following means. In this invention, the server includes means for receiving input from a user, means for sending the input prompt to the generative AI model and generating a code snippet, means for returning the generated code snippet to the user, means for sending a prompt for optimizing the received code to the generative AI model and generating optimized code, means for returning the generated optimized code to the user, means for sending buggy code received from the user to the generative AI model and generating debugged code, means for returning the generated debug code to the user, means for analyzing user emotions using an emotion engine and adjusting the prompts and generated code, and means for being incorporated into a robot control system in a factory and performing code generation, optimization, and debugging to improve robot work efficiency. This automates the generation, optimization, and debugging of robot control code, enabling efficient work that takes operator emotions into consideration.
[0474] "Means for receiving input from a user" refers to a function that receives prompts or codes entered by a user through a terminal.
[0475] "Means for sending an input prompt to a generative AI model and generating a code snippet" refers to a function that sends a prompt entered by a user to a generative AI model and generates specific code based on the prompt.
[0476] The "means for returning the generated code snippet to the user" is a function for returning and displaying the code snippet generated by the generative AI model to the user.
[0477] "Means for sending prompts to optimize the received code to a generative AI model and generating optimized code" refers to a function for sending prompts to optimize existing code entered by a user to a generative AI model, thereby generating optimized code.
[0478] The "means for returning the generated optimized code to the user" is a function for returning the optimized code to the user and displaying it.
[0479] The "means for sending buggy code received from a user to a generative AI model and generating debugged code" refers to a function for sending buggy code entered by a user to a generative AI model and generating debugged code based on the prompts.
[0480] The "means for returning generated debug code to the user" is a function for returning the debugged code to the user and displaying it.
[0481] "Means for analyzing the user's emotions using an emotion engine and adjusting the prompts and generated codes" is a function that uses an emotion engine that analyzes the user's emotions to provide the optimal prompts and codes according to the user's emotional state.
[0482] "A means for being incorporated into the robot control system within a factory and for generating, optimizing, and debugging code to improve the work efficiency of the robot" refers to a function incorporated into the system that controls the robot within a factory, which generates, optimizes, and debugs the code required to improve the work efficiency of the robot.
[0483] This invention relates to a system that utilizes a generative AI model and an emotion engine to realize code generation, optimization, and debugging for a robot control system in a factory. This system is configured as follows to efficiently manage robot programs while taking into account the user's emotions.
[0484] System Configuration
[0485] 1. Terminal
[0486] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[0487] 2. Server
[0488] The server is a multi-functional computer system that works with generative AI models to generate, optimize, and debug code based on prompts, and also includes an emotion engine that recognizes user emotions and reflects them in the code generation process.
[0489] 3. Emotion Engine
[0490] The emotion engine analyzes emotions based on user input and other user data and adjusts the code and prompts output by the generative AI model, reducing user stress and providing a better development experience.
[0491] 4. Users
[0492] A user is a person who operates the system and wants to generate, optimize, and debug code.
[0493] Program Description
[0494] Generate code snippets
[0495] When a user wants to generate robot control code for a specific task, they enter a prompt into the terminal, for example, "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server uses an emotion engine to analyze the user's emotion and sends a request to the generative AI model. This request includes the prompt content and adjustments based on the user's emotion. The generative AI model generates a code snippet based on the prompt and sends the result back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[0496] Code optimization
[0497] When a user wants to optimize existing robot control code, they input the original code into the device. For example, they input the code for a binary search algorithm. The device then sends this optimization request to the server. The server uses an emotion engine to analyze the user's emotions and adjusts the optimization prompt based on those emotions. It then sends the code along with the prompt to a generative AI model, which generates optimized code. The result is then sent back to the server, which then sends the optimized code back to the device, which displays it to the user.
[0498] Debugging bugs
[0499] If a user wants to debug buggy code, they enter the buggy code into their device—for example, a buggy version of the binary search algorithm mentioned above. The device then sends this debug request to the server. The server uses an emotion engine to analyze the user's emotion and tailors the debug prompt based on that emotion. It then sends the code along with the prompt to a generative AI model, which generates debugged code. The result is then sent back to the server, which then sends the debugged code back to the device, which displays it to the user.
[0500] Specific examples
[0501] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[0502] 1. The user types a prompt into the terminal.
[0503] 2. The terminal sends a prompt to the server.
[0504] 3. The server analyzes the user's emotions using an emotion engine and sends a request to a generative AI model to generate a code snippet.
[0505] 4. The server sends the generated code back to the device.
[0506] 5. The terminal displays the code snippet to the user.
[0507] The hardware used in this process includes terminals and servers, and the software uses generative AI models and emotion engines. A specific example of use is "Please optimize the following Python code."
[0508] Please optimize the following Python code:
[0509] code:
[0510] def binary_search(arr, target):
[0511] left, right = 0, len(arr) - 1
[0512] while left <= right:
[0513] mid = (left + right) / / 2
[0514] if arr[mid] == target:
[0515] return mid
[0516] elif arr[mid] < target:
[0517] left = mid + 1
[0518] else:
[0519] right = mid - 1
[0520] return -1
[0521] This allows users to generate, optimize, and debug code efficiently and with consideration for emotions.
[0522] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[0523] Step 1:
[0524] The user uses the terminal to input prompts or code, which can include prompt statements such as "Implement a binary search algorithm in Python" or existing code. The input data is received by the terminal.
[0525] Step 2:
[0526] The device then sends the received prompt or code to the server, which then appropriately formats the input and sends it as data.
[0527] Step 3:
[0528] The server uses an emotion engine to analyze the user's emotions, based on the user's input data, past usage history, etc. The emotion engine analyzes the user's emotional state and adjusts the prompts and generated code based on that data.
[0529] Step 4:
[0530] Based on the user's emotional data analyzed by the emotion engine, the server requests the generative AI model to send prompts and generate code, including adjusting the prompts according to the user's emotions.
[0531] Step 5:
[0532] The generative AI model generates code snippets based on the prompt it receives, for example, "Implement a binary search algorithm in Python," and generates the appropriate Python code. The generated code snippets are then sent back to the server.
[0533] Step 6:
[0534] The server returns the generated code to the device. If any adjustments have been made by the emotion engine, the code that reflects the adjustments is returned.
[0535] Step 7:
[0536] The terminal displays the generated code received from the server to the user, allowing the user to confirm the generated code.
[0537] Step 8:
[0538] If a user wants to optimize an existing code, they input the existing code along with an optimization request into the terminal, for example, "Please optimize the following code" and the original code. The terminal then sends this request and the code to the server.
[0539] Step 9:
[0540] When the server sends an optimization request to the generative AI model, it analyzes the user's emotions using an emotion engine and adjusts the optimization prompt based on the results.
[0541] Step 10:
[0542] The generative AI model optimizes the code based on the tailored prompts and sends the optimized code back to the server.
[0543] Step 11:
[0544] The server returns the optimized code to the terminal, which displays it to the user, who can then view the optimized code.
[0545] Step 12:
[0546] When a user wants to debug buggy code, they enter the buggy code into the terminal along with a debug request, which the terminal sends to the server.
[0547] Step 13:
[0548] When the server sends a debug request to the generative AI model, it analyzes the user's emotions with an emotion engine and adjusts the debug prompt based on the results.
[0549] Step 14:
[0550] The generative AI model performs the debugging tasks based on the tailored prompts and sends the debugged code back to the server.
[0551] Step 15:
[0552] The server sends the debugged code back to the terminal, which displays it to the user, who can then view the debugged code.
[0553] Through these processing steps, the system of the present invention enables the generation, optimization, and debugging of robot control code in an efficient and emotionally sensitive manner.
[0554] The specific processing unit 290 transmits the result of the specific processing to the smart device 14. In the smart device 14, the control unit 46A causes the output device 40 to output the result of the specific processing. The microphone 38B acquires audio indicating a user input regarding the result of the specific processing. The control unit 46A transmits audio data indicating the user input acquired by the microphone 38B to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the audio data.
[0555] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (Internet Search<URL: https: / / openai.com / blog / chatgpt> ), Gemini (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.
[0556] In the above embodiment, an example in which the specific process is performed by the data processing device 12 has been given, but the technology of the present disclosure is not limited to this, and the specific process may be performed by the smart device 14.
[0557] [Second embodiment]
[0558] FIG. 3 shows an example of the configuration of a data processing system 210 according to the second embodiment.
[0559] 3, the data processing system 210 includes the data processing device 12 and smart glasses 214. An example of the data processing device 12 is a server.
[0560] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[0561] The smart glasses 214 include a computer 36, a microphone 238, a speaker 240, a camera 42, and a communication I / F 44. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The microphone 238, the speaker 240, and the camera 42 are also connected to the bus 52.
[0562] The microphone 238 receives instructions and the like from the user 20 by receiving voice uttered by the user 20. The microphone 238 captures the voice uttered by the user 20, converts the captured voice into audio data, and outputs it to the processor 46. The speaker 240 outputs audio in accordance with instructions from the processor 46.
[0563] Camera 42 is a small digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, and captures images of the surroundings of user 20 (for example, an imaging range defined by an angle of view equivalent to the field of vision of a typical healthy person).
[0564] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 control the exchange of various information between the processor 46 and the processor 28 via the network 54. The exchange of various information between the processor 46 and the processor 28 using the communication I / Fs 44 and 26 is carried out in a secure state.
[0565] Fig. 4 shows an example of the main functions of the data processing device 12 and the smart glasses 214. As shown in Fig. 4, in the data processing device 12, a specific process is performed by the processor 28. A specific process program 56 is stored in the storage 32.
[0566] The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific processing is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.
[0567] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.
[0568] In the smart glasses 214, the reception output process is performed by the processor 46. A reception output program 60 is stored in the storage 50. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.
[0569] Next, a description will be given of the identification process performed by the identification processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as the "server" and the smart glasses 214 will be referred to as the "terminal."
[0570] The present invention is a system that generates code snippets based on prompts entered by a user, and further optimizes and debugs the received code. The system is mainly realized through the interaction of a server, a terminal, and a user.
[0571] System Configuration
[0572] 1. Terminal
[0573] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[0574] 2. Server
[0575] The server is a multi-function computer system that works in conjunction with generative AI models to perform prompt-based code generation, optimization, and debugging.
[0576] 3. Users
[0577] Users are developers who operate the system and want to generate, optimize, and debug code.
[0578] Program Description
[0579] Generate code snippets
[0580] When a user wants to generate a code snippet in a particular programming language, they enter a prompt into the terminal, such as "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server receives the prompt and sends a request to the generative AI model. The generative AI model generates a code snippet based on the prompt and sends it back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[0581] Code optimization
[0582] When a user wants to optimize existing code, they input the original code into their device. This optimization request is sent to the server, which then asks a generative AI model to optimize the code. The generative AI model analyzes the code, performs optimizations to improve performance, and sends the result back to the server. The server then sends the optimized code back to the device, which displays it to the user.
[0583] Debugging bugs
[0584] When a user wants to debug a buggy piece of code, they input the code into their device. The device then sends a debug request to the server. The server then asks the generative AI model to fix the bug, which then analyzes the code and fixes the bug. The corrected code is sent back to the server, which then sends it back to the device. Finally, the device displays the corrected debug code to the user.
[0585] Specific examples
[0586] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[0587] 1. The user types a prompt into the terminal.
[0588] 2. The terminal sends a prompt to the server.
[0589] 3. The server sends a request to the generative AI model to generate a code snippet.
[0590] 4. The server sends the generated code back to the device.
[0591] 5. The terminal displays the code snippet to the user.
[0592] A similar process is used for optimizing and debugging code. For example, if a user inputs code, such as "Please optimize the following code," the server sends the request to the generative AI model, which generates the optimized code and sends it back to the device, which then displays it to the user. Similarly, when debugging bugs, the server sends the buggy code to the generative AI model and requests a fix, after which the fixed code is provided to the user via the device.
[0593] This allows users to efficiently generate, optimize, and debug high-quality code.
[0594] The processing flow will be explained below.
[0595] Generate code snippets
[0596] Step 1:
[0597] If a user wants to generate a code snippet in a particular programming language, they type a prompt into the terminal, for example, "Implement a binary search algorithm in Python."
[0598] Step 2:
[0599] The terminal receives the user's input and sends the prompts to the server.
[0600] Step 3:
[0601] The server parses the received prompt and sends a request to the generative AI model, which includes the prompt content and requirements for the code to be generated.
[0602] Step 4:
[0603] The generative AI model generates the appropriate code snippet based on the prompts received and sends the results back to the server.
[0604] Step 5:
[0605] The server receives the generated code snippet and sends it back to the device.
[0606] Step 6:
[0607] The terminal displays the generated code received from the server to the user.
[0608] Code optimization
[0609] Step 1:
[0610] If a user wants to optimize existing code, they input the original code they want to optimize into the terminal, for example, the code for a binary search algorithm.
[0611] Step 2:
[0612] The terminal receives the user's input and sends the optimization request to the server.
[0613] Step 3:
[0614] The server analyzes the received original code and sends an optimization request to the generative AI model, which includes the content of the original code and instructions for optimization.
[0615] Step 4:
[0616] Based on the original code it receives, the generative AI model generates optimized code that improves performance and efficiency, and sends the results back to the server.
[0617] Step 5:
[0618] The server receives the generated optimized code and returns it to the terminal.
[0619] Step 6:
[0620] The terminal displays the optimization code received from the server to the user.
[0621] Debugging bugs
[0622] Step 1:
[0623] If a user wants to debug buggy code, they enter the buggy code into the terminal, for example, a buggy version of the binary search algorithm mentioned above.
[0624] Step 2:
[0625] The terminal receives the user's input and sends the debug request to the server.
[0626] Step 3:
[0627] The server analyzes the received buggy code and sends a debug request to the generative AI model, which includes the contents of the buggy code and instructions for debugging.
[0628] Step 4:
[0629] Based on the buggy code it receives, the generative AI model generates debugged code that fixes the bug and sends the results back to the server.
[0630] Step 5:
[0631] The server receives the generated debug code and sends it back to the device.
[0632] Step 6:
[0633] The terminal displays the debugged code received from the server to the user.
[0634] These steps allow the user to efficiently generate, optimize, and debug code.
[0635] Example 1
[0636] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."
[0637] Conventional systems make it difficult for users to efficiently generate, optimize, and debug program code. In particular, there were issues with the quality of the generated code, the accuracy of optimization, and the accuracy of bug fixes. Furthermore, there was no system that automatically executed corresponding actions based on the prompts and code entered by the user, providing quick results. This could result in reduced developer productivity, leading to project delays and a decline in quality.
[0638] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.
[0639] In this invention, the server includes: [means for receiving input from a user]; [means for sending the entered prompt to a generative AI model and generating a code snippet]; [means for returning the generated code snippet to the user]; [means for sending a prompt for optimizing the received code to a generative AI model and generating optimized code]; [means for returning the generated optimized code to the user]; [means for sending buggy code received from the user to a generative AI model and generating debugged code]; [means for returning the generated debug code to the user]; and [means for displaying the code snippet, optimized code, and debug code generated by the generative AI model. This enables users to efficiently generate, optimize, and debug high-quality code.
[0640] "Users" are the people who operate the system and provide input, and developers who request code generation, optimization, and debugging.
[0641] A "terminal" is a device operated by a user, which accepts and displays input and sends requests to a server.
[0642] The "server" is a computer system that works in conjunction with the generative AI model to generate, optimize, and debug code based on prompts.
[0643] A "prompt" is an instruction that a user enters to request a particular action from the system, such as "Please implement a binary search algorithm in Python."
[0644] A "generative AI model" is an artificial intelligence model that generates code snippets based on user-entered prompts and also optimizes and debugs the received code.
[0645] "Code snippet generation means" refers to a function on the server that sends a prompt to a generation AI model and generates a code snippet.
[0646] "Optimization means" refers to a function that sends prompts to the generative AI model to optimize the code received at the server, and generates optimized code.
[0647] "Debugging means" refers to a function that sends buggy code received from a user to a generation AI model on the server and generates debugged code.
[0648] "Display means" refers to a function that displays to the user the code snippets, optimized code, and debugged code generated by the generative AI model.
[0649] The present invention is a system for generating code snippets based on user prompts, and optimizing and debugging the received code. This system is implemented primarily through the interaction of a server, a terminal, and a user.
[0650] System Configuration
[0651] 1. Terminal
[0652] A terminal is a device operated by a user that accepts input, displays, and transmits requests. A user enters prompts or codes through a terminal. For example, devices that can be used as terminals include PCs, tablets, and smartphones.
[0653] 2. Server
[0654] The server is a multi-function computer system that works in conjunction with a generative AI model, such as the well-known GPT-4, to generate code based on prompts, optimize it, and debug it.
[0655] 3. Users
[0656] The user is a developer who operates the system and wants to generate, optimize, and debug code. The user uses a terminal to enter prompts.
[0657] Program Description
[0658] Generate code snippets
[0659] First, when a user wants to generate a code snippet in a specific programming language, they enter a prompt into the terminal. This prompt might be something like "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server receives the prompt and sends a request to the generative AI model. The generative AI model generates a code snippet based on the prompt and sends it back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[0660] Specific examples
[0661] For example, a user types the prompt "Implement a binary search algorithm in Python" into a terminal. The terminal sends this prompt to a server, which then makes a request to a generative AI model. The generative AI model generates a code snippet and sends it back to the server. The server sends the code snippet to the terminal, which displays it to the user.
[0662] Code optimization
[0663] When a user wants to optimize existing code, they input the original code into their device. This optimization request is sent to the server, which then asks a generative AI model to optimize the code. The generative AI model analyzes the code, performs optimizations to improve performance, and sends the result back to the server. The server then sends the optimized code back to the device, which displays it to the user.
[0664] Specific examples
[0665] If a user types in code like "Please optimize the following Python code," the device sends the request and code to the server, which sends the request to a generative AI model, which generates the optimized code and sends it back to the device, which then displays it to the user.
[0666] Debugging bugs
[0667] When a user wants to debug a buggy piece of code, they input the code into their device. The device then sends a debug request to the server. The server then asks the generative AI model to fix the bug, which then analyzes the code and fixes the bug. The corrected code is sent back to the server, which then sends it back to the device. Finally, the device displays the corrected debug code to the user.
[0668] Specific examples
[0669] If a user inputs a buggy code such as "Please fix the bug in the Python code below," the device sends the request and the code to the server, which sends the request to the generative AI model, which generates the corrected code and sends it back to the device, which displays it to the user.
[0670] The above process allows users to efficiently generate, optimize, and debug high-quality code. This system is realized through the cooperation of servers, terminals, and generative AI models.
[0671] The flow of the identification process in the first embodiment will be described with reference to FIG.
[0672] Program processing flow
[0673] Generate code snippets
[0674] Step 1:
[0675] The user enters a prompt into the terminal. The user enters a prompt sentence such as "Implement a binary search algorithm in Python" into the input field of the terminal. This prepares the terminal to send the prompt sentence to the system.
[0676] Step 2:
[0677] The terminal receives the input prompt text and sends it to the server. Specifically, the terminal sends the prompt text as an HTTP request to the server's API endpoint. Input: Prompt text. Output: Request to the server.
[0678] Step 3:
[0679] The server receives the prompt and forwards it to the generative AI model. The server's internal logic parses the prompt and sends a request to the generative AI model. Input: Prompt. Output: Request to the generative AI model.
[0680] Step 4:
[0681] The generative AI model generates a code snippet based on the received prompt. The generative AI model analyzes the prompt and runs an algorithm to generate the appropriate code. Input: Prompt. Output: Generated code snippet.
[0682] Step 5:
[0683] The server returns the code snippet received from the generative AI model to the device. The server receives the response from the generative AI model and sends it to the device as an HTTP response. Input: Generated code snippet. Output: Response to the device.
[0684] Step 6:
[0685] The terminal displays the generated code snippet to the user. Specifically, the terminal's user interface displays this code in a text area. Input: Generated code snippet. Output: Displayed to the user.
[0686] Code optimization
[0687] Step 1:
[0688] The user inputs the code they want to optimize and their request into the terminal. The user inputs "Please optimize this Python code" and the original code. Input: Optimization request and original code.
[0689] Step 2:
[0690] The device sends the request and original code to the server. The device sends this data to the server as an HTTP request. Input: Optimized request, original code. Output: Request to the server.
[0691] Step 3:
[0692] The server receives the optimization request and the original code and forwards them to the generative AI model. The server sends the received data to the generative AI model in the appropriate format. Input: Optimization request, original code. Output: Request to the generative AI model.
[0693] Step 4:
[0694] A generative AI model analyzes the original code and generates optimized code. The generative AI model applies optimization algorithms to improve performance. Input: Optimization request, original code. Output: Optimized code.
[0695] Step 5:
[0696] The server returns the optimized code received from the generative AI model to the device. The server receives the response from the generative AI model and sends it to the device as an HTTP response. Input: Optimized code. Output: Response to the device.
[0697] Step 6:
[0698] The terminal displays the optimized code to the user. The terminal's user interface displays this optimized code. Input: Optimized code. Output: Display to user.
[0699] Debugging bugs
[0700] Step 1:
[0701] User types buggy code and a debug request into the terminal. User types "Please fix the bug in this Python code" and the buggy code. Input: Debug request and buggy code.
[0702] Step 2:
[0703] The device sends the request and the buggy code to the server. The device sends this data to the server as an HTTP request. Input: Debug request, buggy code. Output: Request to the server.
[0704] Step 3:
[0705] The server receives the debug request and the buggy code and forwards them to the generative AI model. The server sends the received data to the generative AI model in the appropriate format. Input: Debug request, buggy code. Output: Request to the generative AI model.
[0706] Step 4:
[0707] A generative AI model analyzes buggy code and fixes the bug. A generative AI model analyzes the cause of the bug and applies a fix algorithm. Input: Debug request, buggy code. Output: Fixed code.
[0708] Step 5:
[0709] The server returns the corrected code received from the generative AI model to the device. The server receives the response from the generative AI model and sends it to the device as an HTTP response. Input: Corrected code. Output: Response to the device.
[0710] Step 6:
[0711] The terminal displays the modified code to the user. The terminal's user interface displays this modified code. Input: Modified code. Output: Display to user.
[0712] (Application example 1)
[0713] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."
[0714] In conventional factory robot systems, the code required for maintenance and operation is generated, optimized, and debugged manually, resulting in problems of inefficiency and inaccuracy. Furthermore, because the robots themselves lack the ability to perform maintenance tasks autonomously, they face challenges such as high operating costs and long downtime. These issues reduce factory productivity and operational efficiency, undermining competitiveness.
[0715] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.
[0716] In this invention, the server includes means for receiving input from a user, means for sending the input prompt to a generative AI model and generating a code snippet, means for returning the generated code snippet to the user, means for sending a prompt to optimize the received code to the generative AI model and generating optimized code, means for returning the generated optimized code to the user, means for sending buggy code received from the user to the generative AI model and generating debugged code, means for returning the generated debug code to the user, means for generating maintenance work code to assist in robot operation, means for applying the generated maintenance work code to the robot's operation system, and means for optimizing and debugging the code using data from sensors and actuators. This enables the robot to autonomously perform high-quality maintenance work and be operated efficiently.
[0717] "Users" are developers and operators who interact with the system and want to generate, optimize, and debug code.
[0718] A means for receiving "input" is a device or interface through which a user enters prompts or codes, and has the ability to transmit these to the system.
[0719] A "prompt" is a textual input that a user uses to instruct a generative AI model, including instructions for generating a specific code snippet.
[0720] A "generative AI model" is an artificial intelligence model that uses natural language processing techniques to generate code or other output based on prompts.
[0721] A "code snippet" is a portion of program code that is generated to perform a particular task.
[0722] "Optimization" refers to techniques and techniques for improving the performance and efficiency of existing code.
[0723] "Debugging" is a technique for detecting and correcting bugs and errors in existing code.
[0724] A "robot" is a device that operates in a factory and automates manufacturing and maintenance tasks.
[0725] "Maintenance work" refers to calibration, repair, and adjustment work carried out to maintain the performance and lifespan of the robot.
[0726] "Operation system" is a collective term for the hardware and software that controls a robot and allows it to perform specific tasks.
[0727] "Sensor and actuator data" refers to operational data collected from the robot's various sensors (temperature, pressure, position, etc.) and actuators.
[0728] The present invention is a system that generates code snippets based on user-entered prompts, and optimizes and debugs the received code. This system is mainly realized through the interaction of a server, a terminal, and a user.
[0729] System Configuration
[0730] 1. Terminal
[0731] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[0732] 2. Server
[0733] The server performs processing using the following hardware and software.
[0734] Hardware: Cloud or on-premise servers
[0735] software:
[0736] Generative AI models: e.g., GPT-3 and GPT-4
[0737] Data communication: API requests using the HTTP protocol
[0738] The server works with the generative AI model to generate, optimize, and debug code based on prompts, and also generates dedicated maintenance work code and applies it to the robot.
[0739] 3. Users
[0740] Users are developers and operators who operate the system and want to generate, optimize, and debug code.
[0741] Operational procedures and application examples
[0742] Generate code snippets
[0743] When a user wants to generate a code snippet for a specific maintenance task, they enter a prompt into the device, such as "Generate code to calibrate an infrared sensor in Python." The device then sends this prompt to the server, and a generative AI model generates the code snippet based on the prompt.
[0744] Code optimization
[0745] When a user wants to optimize existing maintenance code, they input the original code into the device, for example, in the form of "Please optimize the following code." The device then sends this request to the server, where a generative AI model analyzes the code and performs optimizations to improve performance.
[0746] Debugging bugs
[0747] When a user wants to debug a buggy source code, they input the code into the device, which then sends a debug request to the server, where the generative AI model analyzes the code and fixes the bug.
[0748] Generate and apply maintenance work codes
[0749] To enable the robot to perform self-maintenance, code is generated using a dedicated prompt. For example, enter a prompt such as "Generate code to calibrate the infrared sensor in Python." The generated code is applied to the robot's operating system, allowing it to perform maintenance tasks autonomously.
[0750] By configuring the system in this way and using various hardware and software appropriately, users can efficiently generate, optimize, and debug high-quality code. Furthermore, the robot can autonomously perform maintenance tasks, which is expected to improve operational efficiency.
[0751] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[0752] Step 1:
[0753] The user inputs a prompt into the terminal. Specifically, the user inputs a prompt such as "Please generate code to calibrate the infrared sensor using Python." The input prompt is processed as text data within the terminal.
[0754] Step 2:
[0755] The device sends the prompt entered by the user to the server. Data is transmitted using the HTTP protocol, and the prompt is sent to the server in JSON format. The input data is a prompt sentence, and this data is converted into a request to be sent to the generative AI model.
[0756] Step 3:
[0757] The server sends the received prompt to the generative AI model. The server parses the prompt and sends it as an API request to the generative AI model. The server asks the model to generate a code snippet based on the prompt.
[0758] Step 4:
[0759] The generative AI model generates code snippets based on the prompt. Specifically, the generative AI model uses natural language processing techniques to analyze the prompt and generate the corresponding code snippet. This generation process takes the prompt as data input and provides Python code as text output.
[0760] Step 5:
[0761] The server receives the code snippet returned by the generative AI model and sends it to the device. The code snippet generated on the server is reformatted as text data and sent to the device as an HTTP response.
[0762] Step 6:
[0763] The terminal displays the code snippet received from the server to the user. The terminal parses the data received as an HTTP response and displays the generated code to the user through an appropriate GUI, allowing the user to review the generated code and proceed to the next step if necessary.
[0764] Step 7:
[0765] When a user wants to optimize existing code, they input the original code into the terminal. The user inputs a request such as "Please optimize the following code" and includes the code to be optimized. This input data is used for the next optimization process.
[0766] Step 8:
[0767] The device sends an optimization request to the server. The original code received from the user is sent to the server in JSON format as an optimization request.
[0768] Step 9:
[0769] The server requests the generative AI model to optimize the code. The server sends the received code to the generative AI model and requests the generative AI model to perform optimizations to improve performance.
[0770] Step 10:
[0771] A generative AI model analyzes the code and generates optimized code. The generative AI model uses multiple optimization techniques to improve the performance of the code. The input data is the original code, and the output data is optimized code.
[0772] Step 11:
[0773] The server sends the optimized code to the device, where it is reformatted as text data and sent as an HTTP response to the device.
[0774] Step 12:
[0775] The terminal displays the optimized code received from the server to the user. The terminal analyzes the data received as an HTTP response and displays the optimized code to the user through an appropriate GUI, allowing the user to review the optimized code and proceed to the next step.
[0776] Furthermore, an emotion engine that estimates the user's emotion may be further combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59, and perform identification processing using the user's emotion.
[0777] The present invention provides a system for generating code snippets based on user-entered prompts, and optimizing and debugging the received code. Furthermore, the system's effectiveness is enhanced by incorporating an emotion engine that recognizes the user's emotions and adjusts the generated code and prompts accordingly. The system is specifically implemented as follows:
[0778] System Configuration
[0779] 1. Terminal
[0780] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[0781] 2. Server
[0782] The server is a multi-functional computer system that works with generative AI models to generate, optimize, and debug code based on prompts, and also includes an emotion engine that recognizes user emotions and reflects them in the code generation process.
[0783] 3. Emotion Engine
[0784] The emotion engine analyzes emotions based on user input and other user data, and adjusts the code and optimization prompts output by the generative AI model, reducing user stress and providing a better development experience.
[0785] 4. Users
[0786] Users are developers who operate the system and want to generate, optimize, and debug code.
[0787] Program Description
[0788] Generate code snippets
[0789] When a user wants to generate a code snippet in a specific programming language, they enter a prompt into the terminal, for example, "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server uses an emotion engine to analyze the user's emotion and sends a request to the generative AI model. This request includes the prompt content and adjustments based on the user's emotion. The generative AI model generates a code snippet based on the prompt and sends the result back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[0790] Code optimization
[0791] When a user wants to optimize existing code, they input the original code into the device. For example, they input the code for a binary search algorithm. The device then sends this optimization request to the server. The server uses an emotion engine to analyze the user's emotions and adjusts the optimization prompt based on those emotions. The server then sends the code along with the prompt to a generative AI model, which generates optimized code. The result is then sent back to the server, which then sends the optimized code back to the device, which then displays it to the user.
[0792] Debugging bugs
[0793] If a user wants to debug buggy code, they enter the buggy code into their device—for example, a buggy version of the binary search algorithm mentioned above. The device then sends this debug request to the server. The server uses an emotion engine to analyze the user's emotion and tailors the debug prompt based on that emotion. It then sends the code along with the prompt to a generative AI model, which generates debugged code. The result is then sent back to the server, which then sends the debugged code back to the device, which displays it to the user.
[0794] Specific examples
[0795] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[0796] 1. The user types a prompt into the terminal.
[0797] 2. The terminal sends a prompt to the server.
[0798] 3. The server analyzes the user's emotions using an emotion engine and sends a request to a generative AI model to generate a code snippet.
[0799] 4. The server sends the generated code back to the device.
[0800] 5. The terminal displays the code snippet to the user.
[0801] Optimization and debugging are also performed in a similar manner based on user emotions. For example, if a user enters code saying, "Please optimize the following code," the server analyzes the emotion through the emotion engine and sends an optimization prompt to the generative AI model. The generative AI model then generates optimized code, sends it back to the device via the server, and is ultimately displayed to the user. Bug fixes are also adjusted by the emotion engine, improving user satisfaction.
[0802] This allows users to generate, optimize, and debug code efficiently and with empathy in mind.
[0803] The processing flow will be explained below.
[0804] Generate code snippets
[0805] Step 1:
[0806] A user types a prompt into a terminal indicating that they would like to generate a code snippet in a specific programming language, for example, "Implement a binary search algorithm in Python."
[0807] Step 2:
[0808] The terminal sends this prompt to the server.
[0809] Step 3:
[0810] The server receives the prompt and passes the prompt and user information to the emotion engine to analyze the emotion.
[0811] Step 4:
[0812] The emotion engine analyzes the user's emotions and sends the results back to the server. For example, if the user is feeling stressed, it will return that information.
[0813] Step 5:
[0814] The server adjusts the prompts based on the analysis results of the emotion engine and sends them to the generative AI model.
[0815] Step 6:
[0816] The generative AI model generates code snippets based on the prompts and sends the results back to the server.
[0817] Step 7:
[0818] The server sends the generated code snippet back to the device.
[0819] Step 8:
[0820] The terminal displays the generated code received from the server to the user.
[0821] Code optimization
[0822] Step 1:
[0823] The user enters the original code into the terminal along with a request to optimize the existing code, for example, the code for a binary search algorithm.
[0824] Step 2:
[0825] The device sends this optimization request to the server.
[0826] Step 3:
[0827] The server receives the request and passes the original code and user information to the emotion engine to analyze the emotion.
[0828] Step 4:
[0829] The emotion engine analyzes the user's emotions and sends the results back to the server. For example, if the user is feeling anxious, it will return that information.
[0830] Step 5:
[0831] The server adjusts the optimization prompt based on the analysis results of the emotion engine and sends it to the generative AI model.
[0832] Step 6:
[0833] The generative AI model generates optimized code to improve performance based on the optimization prompts and sends the results back to the server.
[0834] Step 7:
[0835] The server returns the generated optimized code to the terminal.
[0836] Step 8:
[0837] The terminal displays the optimization code received from the server to the user.
[0838] Debugging bugs
[0839] Step 1:
[0840] A user enters buggy code into a terminal along with a request to debug the code, for example, a buggy version of a binary search algorithm.
[0841] Step 2:
[0842] The device sends this debug request to the server.
[0843] Step 3:
[0844] The server receives the request and passes the buggy code and user information to the emotion engine to analyze the emotion.
[0845] Step 4:
[0846] The emotion engine analyzes the user's emotions and sends the results back to the server. For example, if the user is irritated, it will return that information.
[0847] Step 5:
[0848] The server adjusts the debug prompt based on the analysis results of the emotion engine and sends it to the generative AI model.
[0849] Step 6:
[0850] The generative AI model generates code that fixes the bug based on the debug prompts and sends the results back to the server.
[0851] Step 7:
[0852] The server sends the generated debug code back to the device.
[0853] Step 8:
[0854] The terminal displays the debug code received from the server to the user.
[0855] These steps allow users to generate, optimize, and debug code efficiently and with emotion in mind.
[0856] Example 2
[0857] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."
[0858] In conventional code generation systems, users input prompts and the generated code is not always optimized for the user's emotions or situation, which often leads to stress and dissatisfaction. Furthermore, code optimization and debugging must be done manually, making the development process inefficient. As a result, developer productivity is reduced.
[0859] The specific processing by the specific processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means.
[0860] In this invention, the server includes: [means for receiving input from a user; [means for sending the entered prompt to a generative AI model and generating a code snippet; [means for returning the generated code snippet to the user;] [means for sending a prompt for optimizing the received code to a generative AI model and generating optimized code; [means for returning the generated optimized code to the user;] [means for sending buggy code received from the user to a generative AI model and generating debugged code; [means for returning the generated debug code to the user; and] means for analyzing the user's emotions using an emotion engine and adjusting the prompts and generated code based thereon. This makes it possible [to generate, optimize, and debug code according to the user's emotions and needs].
[0861] "User" refers to the developer or programmer who operates the system and requests code generation, optimization, and debugging.
[0862] A "terminal" is a device operated by a user, such as a computer or mobile device, that accepts input, sends requests, and displays results.
[0863] "Server" refers to a high-performance computer system for running the generative AI model and emotion engine, as well as receiving prompts, emotion analysis, code generation, optimization, and debugging.
[0864] A "prompt" is an instruction or request that a user enters into the system, such as a request for code generation, optimization, or debugging.
[0865] "Code snippet" refers to a portion of a program generated by a generative AI model.
[0866] "Generative AI model" refers to an artificial intelligence model used to generate, optimize, and debug code based on user prompts.
[0867] An "emotion engine" refers to a technology that analyzes emotions based on user input and past interactions and reflects the results in a generative AI model.
[0868] "Optimization" refers to the process of making existing code more efficient and performant.
[0869] "Debugging" refers to the process of fixing buggy code so that it works properly.
[0870] The present invention is a system that generates code snippets based on user-entered prompts, and then optimizes and debugs the received code. Furthermore, the system incorporates an emotion engine that recognizes the user's emotions and adjusts the generated code and prompts accordingly, enhancing its effectiveness. The system of the present invention consists of several key components:
[0871] System Components
[0872] 1. Users
[0873] The user is a developer who operates the system and wants to generate code, optimize, and debug it. The user enters prompts and code into a terminal and receives the results.
[0874] 2. Terminal
[0875] A terminal is a device operated by a user that accepts input, displays, and sends requests. Users enter prompts and codes through the terminal. The terminal can be a PC, smartphone, tablet, etc.
[0876] 3. Server
[0877] The server is a multi-functional computer system that works with the generative AI model to generate, optimize, and debug code based on prompts. It also has an emotion engine that recognizes user emotions and reflects them in the code generation process. Specifically, it uses a natural language generation engine (e.g., GPT-3) as the generative AI model and EmotionAPI or similar for the emotion engine.
[0878] 4. Generative AI Models
[0879] Generative AI models are natural language generation engines used to generate, optimize, and debug code based on user prompts, with GPT-3 being an example use case.
[0880] 5. Emotion Engine
[0881] The emotion engine is a technology that analyzes emotions based on user input and past interactions and reflects the results in generative AI models. It uses EmotionAPI to analyze user emotions.
[0882] Explanation of program processing
[0883] Generate code snippets
[0884] When a user wants to generate a code snippet in a specific programming language, they enter a prompt into their device: "Implement a binary search algorithm in Python." The device then sends this prompt to the server. The server uses an emotion engine to analyze the user's emotion and sends the analysis result and the prompt to the generative AI model. The generative AI model uses this information to generate a code snippet and sends it back to the server. The server then sends the generated code snippet back to the device, which then displays it to the user.
[0885] Code optimization
[0886] When a user wants to optimize existing code, they input the original code into their device. For example, they input the code for a binary search algorithm. The device then sends this optimization request to the server. The server uses an emotion engine to analyze the user's emotions and sends the analysis results and the original code as an optimization prompt to the generative AI model. The generative AI model generates optimized code and sends it back to the server. The server then sends the optimized code back to the device, which displays it to the user.
[0887] Debugging bugs
[0888] When a user wants to debug buggy code, they input the buggy code into their device. For example, they input the code for a buggy binary search algorithm. The device then sends this debug request to the server. The server uses an emotion engine to analyze the user's emotions and sends the analysis result and the buggy code as a debug prompt to the generative AI model. The generative AI model generates debugged code and sends it back to the server. The server then sends the debugged code back to the device, which then displays it to the user.
[0889] Specific examples
[0890] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[0891] 1. The user types a prompt into the terminal.
[0892] 2. The terminal sends a prompt to the server.
[0893] 3. The server analyzes the user's emotions using an emotion engine and sends a request to a generative AI model to generate a code snippet.
[0894] 4. The server sends the generated code snippet back to the device.
[0895] 5. The terminal displays the code snippet to the user.
[0896] Optimization and debugging are also performed in a similar manner based on user emotions. For example, if a user enters code saying, "Please optimize the following code," the server analyzes the emotion through the emotion engine and sends an optimization prompt to the generative AI model. The generative AI model then generates optimized code, sends it back to the device via the server, and is ultimately displayed to the user. Bug fixes are also adjusted by the emotion engine, improving user satisfaction.
[0897] As described above, the present invention allows users to generate, optimize, and debug code efficiently while taking emotions into account.
[0898] The flow of the identification process in the second embodiment will be described with reference to FIG.
[0899] Generate code snippets
[0900] Step 1:
[0901] If a user wants to generate a code snippet in a specific programming language, they can type the prompt "Implement a binary search algorithm in Python" into the terminal.
[0902] Input: Prompt statement "Implement a binary search algorithm in Python"
[0903] Output: The prompt the user types into the terminal
[0904] Step 2:
[0905] The terminal sends the entered prompt to the server.
[0906] Input: The prompt received from the user
[0907] Data processing: Convert the prompt text into a format that can be sent to the server as an HTTP request
[0908] Output: Prompt text sent to the server
[0909] Step 3:
[0910] The server uses an emotion engine to analyze the user's emotions.
[0911] Input: The prompt sent to the server and the user's previous input data
[0912] Data calculation: Sentiment analysis using sentiment analysis tools such as EmotionAPI
[0913] Output: Sentiment analysis results (e.g., stress level, satisfaction, etc.)
[0914] Step 4:
[0915] The server sends the emotion analysis results and prompt sentence as a request to the generative AI model.
[0916] Input: prompt and sentiment analysis results
[0917] Data processing: shaping data into a format that can be fed into a generative AI model
[0918] Output: The request sent to the generative AI model
[0919] Step 5:
[0920] The generative AI model generates a code snippet based on the prompt text and sentiment analysis results and sends it back to the server.
[0921] Input: The request sent by the server
[0922] Data Calculation: Code generation based on prompt sentences and sentiment analysis results
[0923] Output: Generated code snippet
[0924] Step 6:
[0925] The server sends the generated code snippet back to the device.
[0926] Input: Code snippet received from the generative AI model
[0927] Data processing: Converting data into a format that can be sent back to the device as an HTTP response
[0928] Output: Code snippet sent to the terminal
[0929] Step 7:
[0930] The terminal displays the code snippet to the user.
[0931] Input: Code snippet received from the server
[0932] Data processing: Display in a visually understandable format for users
[0933] Output: The code snippet displayed to the user
[0934] Code optimization
[0935] Step 1:
[0936] The user enters into the terminal the existing code they wish to optimize, for example the code for a binary search algorithm.
[0937] Input: Original code
[0938] Output: The original code that the user entered into the terminal
[0939] Step 2:
[0940] The device sends an optimization request to the server.
[0941] Input: The code received from the user
[0942] Data processing: Converting data into a format to be sent to the server as an HTTP request
[0943] Output: The code sent to the server
[0944] Step 3:
[0945] The server uses an emotion engine to analyze the user's emotions.
[0946] Input: The code sent to the server and any previous inputs from the user
[0947] Data calculation: Sentiment analysis using sentiment analysis tools such as EmotionAPI
[0948] Output: Emotion analysis results
[0949] Step 4:
[0950] The server sends the sentiment analysis results and the original code as a request to the generated AI model.
[0951] Input: Original code and sentiment analysis results
[0952] Data processing: shaping data into a format that can be fed into a generative AI model
[0953] Output: The request sent to the generative AI model
[0954] Step 5:
[0955] The generative AI model generates optimized code based on the original code and sends it back to the server.
[0956] Input: The request sent by the server
[0957] Data calculation: Optimization process based on the original code and sentiment analysis results
[0958] Output: Optimized code
[0959] Step 6:
[0960] The server sends the optimized code back to the device.
[0961] Input: Optimized code received from a generative AI model
[0962] Data processing: Converting data into a format that can be sent back to the device as an HTTP response
[0963] Output: Optimized code sent to the terminal
[0964] Step 7:
[0965] The terminal displays the optimized code to the user.
[0966] Input: Optimized code received from the server
[0967] Data processing: Display in a visually understandable format for users
[0968] Output: The optimized code displayed to the user
[0969] Debugging bugs
[0970] Step 1:
[0971] The user types into the terminal the buggy code they want to debug, for example the code for a buggy binary search algorithm.
[0972] Input: Buggy code
[0973] Output: The buggy code as entered by the user into the terminal
[0974] Step 2:
[0975] The device sends a debug request to the server.
[0976] Input: Buggy code received from the user
[0977] Data processing: Converting data into a format to be sent to the server as an HTTP request
[0978] Output: The buggy code sent to the server
[0979] Step 3:
[0980] The server uses an emotion engine to analyze the user's emotions.
[0981] Input: The buggy code sent to the server and the user's previous input data
[0982] Data calculation: Sentiment analysis using sentiment analysis tools such as EmotionAPI
[0983] Output: Emotion analysis results
[0984] Step 4:
[0985] The server sends the sentiment analysis results and the buggy code as a request to the generated AI model.
[0986] Input: Buggy code and sentiment analysis results
[0987] Data processing: shaping data into a format that can be fed into a generative AI model
[0988] Output: The request sent to the generative AI model
[0989] Step 5:
[0990] The generative AI model generates debugged code based on the buggy code and sends it back to the server.
[0991] Input: The request sent by the server
[0992] Data calculation: Debugging process based on buggy code and sentiment analysis results
[0993] Output: Debugged code
[0994] Step 6:
[0995] The server sends the debugged code back to the device.
[0996] Input: Debugged code received from the generative AI model
[0997] Data processing: Converting data into a format that can be sent back to the device as an HTTP response
[0998] Output: Debugged code sent to the terminal
[0999] Step 7:
[1000] The terminal displays the debugged code to the user.
[1001] Input: The debugged code received from the server
[1002] Data processing: Display in a visually understandable format for users
[1003] Output: The debugged code displayed to the user
[1004] (Application example 2)
[1005] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the smart glasses 214 will be referred to as a "terminal."
[1006] Managing robot operations efficiently and safely is a key challenge for factory robot control systems. However, currently, generating, optimizing, and debugging robot program code requires a significant amount of time and expertise. In particular, when a problem occurs in the robot's control code, it is difficult to quickly debug it, significantly impacting productivity. Furthermore, the emotional state of the operator can lead to stress and reduced work efficiency. To address these issues, a system is needed that takes into account the operator's emotions while automating robot program code management.
[1007] The specific processing by the specific processing unit 290 of the data processing device 12 in Application Example 2 is realized by the following means. In this invention, the server includes means for receiving input from a user, means for sending the input prompt to the generative AI model and generating a code snippet, means for returning the generated code snippet to the user, means for sending a prompt for optimizing the received code to the generative AI model and generating optimized code, means for returning the generated optimized code to the user, means for sending buggy code received from the user to the generative AI model and generating debugged code, means for returning the generated debug code to the user, means for analyzing user emotions using an emotion engine and adjusting the prompts and generated code, and means for being incorporated into a robot control system in a factory and performing code generation, optimization, and debugging to improve robot work efficiency. This automates the generation, optimization, and debugging of robot control code, enabling efficient work that takes operator emotions into consideration.
[1008] "Means for receiving input from a user" refers to a function that receives prompts or codes entered by a user through a terminal.
[1009] "Means for sending an input prompt to a generative AI model and generating a code snippet" refers to a function that sends a prompt entered by a user to a generative AI model and generates specific code based on the prompt.
[1010] The "means for returning the generated code snippet to the user" is a function for returning and displaying the code snippet generated by the generative AI model to the user.
[1011] "Means for sending prompts to optimize the received code to a generative AI model and generating optimized code" refers to a function for sending prompts to optimize existing code entered by a user to a generative AI model, thereby generating optimized code.
[1012] The "means for returning the generated optimized code to the user" is a function for returning the optimized code to the user and displaying it.
[1013] The "means for sending buggy code received from a user to a generative AI model and generating debugged code" refers to a function for sending buggy code entered by a user to a generative AI model and generating debugged code based on the prompts.
[1014] The "means for returning generated debug code to the user" is a function for returning the debugged code to the user and displaying it.
[1015] "Means for analyzing the user's emotions using an emotion engine and adjusting the prompts and generated codes" is a function that uses an emotion engine that analyzes the user's emotions to provide the optimal prompts and codes according to the user's emotional state.
[1016] "A means for being incorporated into the robot control system within a factory and for generating, optimizing, and debugging code to improve the work efficiency of the robot" refers to a function incorporated into the system that controls the robot within a factory, which generates, optimizes, and debugs the code required to improve the work efficiency of the robot.
[1017] This invention relates to a system that utilizes a generative AI model and an emotion engine to realize code generation, optimization, and debugging for a robot control system in a factory. This system is configured as follows to efficiently manage robot programs while taking into account the user's emotions.
[1018] System Configuration
[1019] 1. Terminal
[1020] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[1021] 2. Server
[1022] The server is a multi-functional computer system that works with generative AI models to generate, optimize, and debug code based on prompts, and also includes an emotion engine that recognizes user emotions and reflects them in the code generation process.
[1023] 3. Emotion Engine
[1024] The emotion engine analyzes emotions based on user input and other user data and adjusts the code and prompts output by the generative AI model, reducing user stress and providing a better development experience.
[1025] 4. Users
[1026] A user is a person who operates the system and wants to generate, optimize, and debug code.
[1027] Program Description
[1028] Generate code snippets
[1029] When a user wants to generate robot control code for a specific task, they enter a prompt into the terminal, for example, "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server uses an emotion engine to analyze the user's emotion and sends a request to the generative AI model. This request includes the prompt content and adjustments based on the user's emotion. The generative AI model generates a code snippet based on the prompt and sends the result back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[1030] Code optimization
[1031] When a user wants to optimize existing robot control code, they input the original code into the device. For example, they input the code for a binary search algorithm. The device then sends this optimization request to the server. The server uses an emotion engine to analyze the user's emotions and adjusts the optimization prompt based on those emotions. It then sends the code along with the prompt to a generative AI model, which generates optimized code. The result is then sent back to the server, which then sends the optimized code back to the device, which displays it to the user.
[1032] Debugging bugs
[1033] If a user wants to debug buggy code, they enter the buggy code into their device—for example, a buggy version of the binary search algorithm mentioned above. The device then sends this debug request to the server. The server uses an emotion engine to analyze the user's emotion and tailors the debug prompt based on that emotion. It then sends the code along with the prompt to a generative AI model, which generates debugged code. The result is then sent back to the server, which then sends the debugged code back to the device, which displays it to the user.
[1034] Specific examples
[1035] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[1036] 1. The user types a prompt into the terminal.
[1037] 2. The terminal sends a prompt to the server.
[1038] 3. The server analyzes the user's emotions using an emotion engine and sends a request to a generative AI model to generate a code snippet.
[1039] 4. The server sends the generated code back to the device.
[1040] 5. The terminal displays the code snippet to the user.
[1041] The hardware used in this process includes terminals and servers, and the software uses generative AI models and emotion engines. A specific example of use is "Please optimize the following Python code."
[1042] Please optimize the following Python code:
[1043] code:
[1044] def binary_search(arr, target):
[1045] left, right = 0, len(arr) - 1
[1046] while left <= right:
[1047] mid = (left + right) / / 2
[1048] if arr[mid] == target:
[1049] return mid
[1050] elif arr[mid] < target:
[1051] left = mid + 1
[1052] else:
[1053] right = mid - 1
[1054] return -1
[1055] This allows users to generate, optimize, and debug code efficiently and with consideration for emotions.
[1056] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[1057] Step 1:
[1058] The user uses the terminal to input prompts or code, which can include prompt statements such as "Implement a binary search algorithm in Python" or existing code. The input data is received by the terminal.
[1059] Step 2:
[1060] The device then sends the received prompt or code to the server, which then appropriately formats the input and sends it as data.
[1061] Step 3:
[1062] The server uses an emotion engine to analyze the user's emotions, based on the user's input data, past usage history, etc. The emotion engine analyzes the user's emotional state and adjusts the prompts and generated code based on that data.
[1063] Step 4:
[1064] Based on the user's emotional data analyzed by the emotion engine, the server requests the generative AI model to send prompts and generate code, including adjusting the prompts according to the user's emotions.
[1065] Step 5:
[1066] The generative AI model generates code snippets based on the prompt it receives, for example, "Implement a binary search algorithm in Python," and generates the appropriate Python code. The generated code snippets are then sent back to the server.
[1067] Step 6:
[1068] The server returns the generated code to the device. If any adjustments have been made by the emotion engine, the code that reflects the adjustments is returned.
[1069] Step 7:
[1070] The terminal displays the generated code received from the server to the user, allowing the user to confirm the generated code.
[1071] Step 8:
[1072] If a user wants to optimize an existing code, they input the existing code along with an optimization request into the terminal, for example, "Please optimize the following code" and the original code. The terminal then sends this request and the code to the server.
[1073] Step 9:
[1074] When the server sends an optimization request to the generative AI model, it analyzes the user's emotions using an emotion engine and adjusts the optimization prompt based on the results.
[1075] Step 10:
[1076] The generative AI model optimizes the code based on the tailored prompts and sends the optimized code back to the server.
[1077] Step 11:
[1078] The server returns the optimized code to the terminal, which displays it to the user, who can then view the optimized code.
[1079] Step 12:
[1080] When a user wants to debug buggy code, they enter the buggy code into the terminal along with a debug request, which the terminal sends to the server.
[1081] Step 13:
[1082] When the server sends a debug request to the generative AI model, it analyzes the user's emotions with an emotion engine and adjusts the debug prompt based on the results.
[1083] Step 14:
[1084] The generative AI model performs the debugging tasks based on the tailored prompts and sends the debugged code back to the server.
[1085] Step 15:
[1086] The server sends the debugged code back to the terminal, which displays it to the user, who can then view the debugged code.
[1087] Through these processing steps, the system of the present invention enables the generation, optimization, and debugging of robot control code in an efficient and emotionally sensitive manner.
[1088] The specific processing unit 290 transmits the result of the specific processing to the smart glasses 214. In the smart glasses 214, the control unit 46A causes the speaker 240 to output the result of the specific processing. The microphone 238 acquires audio indicating a user input regarding the result of the specific processing. The control unit 46A transmits audio data indicating the user input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the audio data.
[1089] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (Internet Search<URL: https: / / openai.com / blog / chatgpt> ), Gemini (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.
[1090] In the above embodiment, an example in which the specific processing is performed by the data processing device 12 has been given, but the technology of the present disclosure is not limited to this, and the specific processing may be performed by the smart glasses 214.
[1091] [Third embodiment]
[1092] FIG. 5 shows an example of the configuration of a data processing system 310 according to the third embodiment.
[1093] 5, the data processing system 310 includes the data processing device 12 and a headset type terminal 314. An example of the data processing device 12 is a server.
[1094] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[1095] The headset type terminal 314 includes a computer 36, a microphone 238, a speaker 240, a camera 42, a communication I / F 44, and a display 343. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The microphone 238, the speaker 240, the camera 42, and the display 343 are also connected to the bus 52.
[1096] The microphone 238 receives instructions and the like from the user 20 by receiving voice uttered by the user 20. The microphone 238 captures the voice uttered by the user 20, converts the captured voice into audio data, and outputs it to the processor 46. The speaker 240 outputs audio in accordance with instructions from the processor 46.
[1097] Camera 42 is a small digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, and captures images of the surroundings of user 20 (for example, an imaging range defined by an angle of view equivalent to the field of vision of a typical healthy person).
[1098] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 control the exchange of various information between the processor 46 and the processor 28 via the network 54. The exchange of various information between the processor 46 and the processor 28 using the communication I / Fs 44 and 26 is carried out in a secure state.
[1099] Fig. 6 shows an example of the main functions of the data processing device 12 and the headset type terminal 314. As shown in Fig. 6, in the data processing device 12, a specific process is performed by the processor 28. A specific process program 56 is stored in the storage 32.
[1100] The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific processing is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.
[1101] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.
[1102] In the headset type terminal 314, a reception output process is performed by the processor 46. A reception output program 60 is stored in the storage 50. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.
[1103] Next, a description will be given of the identification process performed by the identification processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as the "server" and the headset type terminal 314 will be referred to as the "terminal."
[1104] The present invention is a system that generates code snippets based on prompts entered by a user, and further optimizes and debugs the received code. The system is mainly realized through the interaction of a server, a terminal, and a user.
[1105] System Configuration
[1106] 1. Terminal
[1107] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[1108] 2. Server
[1109] The server is a multi-function computer system that works in conjunction with generative AI models to perform prompt-based code generation, optimization, and debugging.
[1110] 3. Users
[1111] Users are developers who operate the system and want to generate, optimize, and debug code.
[1112] Program Description
[1113] Generate code snippets
[1114] When a user wants to generate a code snippet in a particular programming language, they enter a prompt into the terminal, such as "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server receives the prompt and sends a request to the generative AI model. The generative AI model generates a code snippet based on the prompt and sends it back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[1115] Code optimization
[1116] When a user wants to optimize existing code, they input the original code into their device. This optimization request is sent to the server, which then asks a generative AI model to optimize the code. The generative AI model analyzes the code, performs optimizations to improve performance, and sends the result back to the server. The server then sends the optimized code back to the device, which displays it to the user.
[1117] Debugging bugs
[1118] When a user wants to debug a buggy piece of code, they input the code into their device. The device then sends a debug request to the server. The server then asks the generative AI model to fix the bug, which then analyzes the code and fixes the bug. The corrected code is sent back to the server, which then sends it back to the device. Finally, the device displays the corrected debug code to the user.
[1119] Specific examples
[1120] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[1121] 1. The user types a prompt into the terminal.
[1122] 2. The terminal sends a prompt to the server.
[1123] 3. The server sends a request to the generative AI model to generate a code snippet.
[1124] 4. The server sends the generated code back to the device.
[1125] 5. The terminal displays the code snippet to the user.
[1126] A similar process is used for optimizing and debugging code. For example, if a user inputs code, such as "Please optimize the following code," the server sends the request to the generative AI model, which generates the optimized code and sends it back to the device, which then displays it to the user. Similarly, when debugging bugs, the server sends the buggy code to the generative AI model and requests a fix, after which the fixed code is provided to the user via the device.
[1127] This allows users to efficiently generate, optimize, and debug high-quality code.
[1128] The processing flow will be explained below.
[1129] Generate code snippets
[1130] Step 1:
[1131] If a user wants to generate a code snippet in a particular programming language, they type a prompt into the terminal, for example, "Implement a binary search algorithm in Python."
[1132] Step 2:
[1133] The terminal receives the user's input and sends the prompts to the server.
[1134] Step 3:
[1135] The server parses the received prompt and sends a request to the generative AI model, which includes the prompt content and requirements for the code to be generated.
[1136] Step 4:
[1137] The generative AI model generates the appropriate code snippet based on the prompts received and sends the results back to the server.
[1138] Step 5:
[1139] The server receives the generated code snippet and sends it back to the device.
[1140] Step 6:
[1141] The terminal displays the generated code received from the server to the user.
[1142] Code optimization
[1143] Step 1:
[1144] If a user wants to optimize existing code, they input the original code they want to optimize into the terminal, for example, the code for a binary search algorithm.
[1145] Step 2:
[1146] The terminal receives the user's input and sends the optimization request to the server.
[1147] Step 3:
[1148] The server analyzes the received original code and sends an optimization request to the generative AI model, which includes the content of the original code and instructions for optimization.
[1149] Step 4:
[1150] Based on the original code it receives, the generative AI model generates optimized code that improves performance and efficiency, and sends the results back to the server.
[1151] Step 5:
[1152] The server receives the generated optimized code and returns it to the terminal.
[1153] Step 6:
[1154] The terminal displays the optimization code received from the server to the user.
[1155] Debugging bugs
[1156] Step 1:
[1157] If a user wants to debug buggy code, they enter the buggy code into the terminal, for example, a buggy version of the binary search algorithm mentioned above.
[1158] Step 2:
[1159] The terminal receives the user's input and sends the debug request to the server.
[1160] Step 3:
[1161] The server analyzes the received buggy code and sends a debug request to the generative AI model, which includes the contents of the buggy code and instructions for debugging.
[1162] Step 4:
[1163] Based on the buggy code it receives, the generative AI model generates debugged code that fixes the bug and sends the results back to the server.
[1164] Step 5:
[1165] The server receives the generated debug code and sends it back to the device.
[1166] Step 6:
[1167] The terminal displays the debugged code received from the server to the user.
[1168] These steps allow the user to efficiently generate, optimize, and debug code.
[1169] Example 1
[1170] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."
[1171] Conventional systems make it difficult for users to efficiently generate, optimize, and debug program code. In particular, there were issues with the quality of the generated code, the accuracy of optimization, and the accuracy of bug fixes. Furthermore, there was no system that automatically executed corresponding actions based on the prompts and code entered by the user, providing quick results. This could result in reduced developer productivity, leading to project delays and a decline in quality.
[1172] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.
[1173] In this invention, the server includes: [means for receiving input from a user]; [means for sending the entered prompt to a generative AI model and generating a code snippet]; [means for returning the generated code snippet to the user]; [means for sending a prompt for optimizing the received code to a generative AI model and generating optimized code]; [means for returning the generated optimized code to the user]; [means for sending buggy code received from the user to a generative AI model and generating debugged code]; [means for returning the generated debug code to the user]; and [means for displaying the code snippet, optimized code, and debug code generated by the generative AI model. This enables users to efficiently generate, optimize, and debug high-quality code.
[1174] "Users" are the people who operate the system and provide input, and developers who request code generation, optimization, and debugging.
[1175] A "terminal" is a device operated by a user, which accepts and displays input and sends requests to a server.
[1176] The "server" is a computer system that works in conjunction with the generative AI model to generate, optimize, and debug code based on prompts.
[1177] A "prompt" is an instruction that a user enters to request a particular action from the system, such as "Please implement a binary search algorithm in Python."
[1178] A "generative AI model" is an artificial intelligence model that generates code snippets based on user-entered prompts and also optimizes and debugs the received code.
[1179] "Code snippet generation means" refers to a function on the server that sends a prompt to a generation AI model and generates a code snippet.
[1180] "Optimization means" refers to a function that sends prompts to the generative AI model to optimize the code received at the server, and generates optimized code.
[1181] "Debugging means" refers to a function that sends buggy code received from a user to a generation AI model on the server and generates debugged code.
[1182] "Display means" refers to a function that displays to the user the code snippets, optimized code, and debugged code generated by the generative AI model.
[1183] The present invention is a system for generating code snippets based on user prompts, and optimizing and debugging the received code. This system is implemented primarily through the interaction of a server, a terminal, and a user.
[1184] System Configuration
[1185] 1. Terminal
[1186] A terminal is a device operated by a user that accepts input, displays, and transmits requests. A user enters prompts or codes through a terminal. For example, devices that can be used as terminals include PCs, tablets, and smartphones.
[1187] 2. Server
[1188] The server is a multi-function computer system that works in conjunction with a generative AI model, such as the well-known GPT-4, to generate code based on prompts, optimize it, and debug it.
[1189] 3. Users
[1190] The user is a developer who operates the system and wants to generate, optimize, and debug code. The user uses a terminal to enter prompts.
[1191] Program Description
[1192] Generate code snippets
[1193] First, when a user wants to generate a code snippet in a specific programming language, they enter a prompt into the terminal. This prompt might be something like "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server receives the prompt and sends a request to the generative AI model. The generative AI model generates a code snippet based on the prompt and sends it back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[1194] Specific examples
[1195] For example, a user types the prompt "Implement a binary search algorithm in Python" into a terminal. The terminal sends this prompt to a server, which then makes a request to a generative AI model. The generative AI model generates a code snippet and sends it back to the server. The server sends the code snippet to the terminal, which displays it to the user.
[1196] Code optimization
[1197] When a user wants to optimize existing code, they input the original code into their device. This optimization request is sent to the server, which then asks a generative AI model to optimize the code. The generative AI model analyzes the code, performs optimizations to improve performance, and sends the result back to the server. The server then sends the optimized code back to the device, which displays it to the user.
[1198] Specific examples
[1199] If a user types in code like "Please optimize the following Python code," the device sends the request and code to the server, which sends the request to a generative AI model, which generates the optimized code and sends it back to the device, which then displays it to the user.
[1200] Debugging bugs
[1201] When a user wants to debug a buggy piece of code, they input the code into their device. The device then sends a debug request to the server. The server then asks the generative AI model to fix the bug, which then analyzes the code and fixes the bug. The corrected code is sent back to the server, which then sends it back to the device. Finally, the device displays the corrected debug code to the user.
[1202] Specific examples
[1203] If a user inputs a buggy code such as "Please fix the bug in the Python code below," the device sends the request and the code to the server, which sends the request to the generative AI model, which generates the corrected code and sends it back to the device, which displays it to the user.
[1204] The above process allows users to efficiently generate, optimize, and debug high-quality code. This system is realized through the cooperation of servers, terminals, and generative AI models.
[1205] The flow of the identification process in the first embodiment will be described with reference to FIG.
[1206] Program processing flow
[1207] Generate code snippets
[1208] Step 1:
[1209] The user enters a prompt into the terminal. The user enters a prompt sentence such as "Implement a binary search algorithm in Python" into the input field of the terminal. This prepares the terminal to send the prompt sentence to the system.
[1210] Step 2:
[1211] The terminal receives the input prompt text and sends it to the server. Specifically, the terminal sends the prompt text as an HTTP request to the server's API endpoint. Input: Prompt text. Output: Request to the server.
[1212] Step 3:
[1213] The server receives the prompt and forwards it to the generative AI model. The server's internal logic parses the prompt and sends a request to the generative AI model. Input: Prompt. Output: Request to the generative AI model.
[1214] Step 4:
[1215] The generative AI model generates a code snippet based on the received prompt. The generative AI model analyzes the prompt and runs an algorithm to generate the appropriate code. Input: Prompt. Output: Generated code snippet.
[1216] Step 5:
[1217] The server returns the code snippet received from the generative AI model to the device. The server receives the response from the generative AI model and sends it to the device as an HTTP response. Input: Generated code snippet. Output: Response to the device.
[1218] Step 6:
[1219] The terminal displays the generated code snippet to the user. Specifically, the terminal's user interface displays this code in a text area. Input: Generated code snippet. Output: Displayed to the user.
[1220] Code optimization
[1221] Step 1:
[1222] The user inputs the code they want to optimize and their request into the terminal. The user inputs "Please optimize this Python code" and the original code. Input: Optimization request and original code.
[1223] Step 2:
[1224] The device sends the request and original code to the server. The device sends this data to the server as an HTTP request. Input: Optimized request, original code. Output: Request to the server.
[1225] Step 3:
[1226] The server receives the optimization request and the original code and forwards them to the generative AI model. The server sends the received data to the generative AI model in the appropriate format. Input: Optimization request, original code. Output: Request to the generative AI model.
[1227] Step 4:
[1228] A generative AI model analyzes the original code and generates optimized code. The generative AI model applies optimization algorithms to improve performance. Input: Optimization request, original code. Output: Optimized code.
[1229] Step 5:
[1230] The server returns the optimized code received from the generative AI model to the device. The server receives the response from the generative AI model and sends it to the device as an HTTP response. Input: Optimized code. Output: Response to the device.
[1231] Step 6:
[1232] The terminal displays the optimized code to the user. The terminal's user interface displays this optimized code. Input: Optimized code. Output: Display to user.
[1233] Debugging bugs
[1234] Step 1:
[1235] User types buggy code and a debug request into the terminal. User types "Please fix the bug in this Python code" and the buggy code. Input: Debug request and buggy code.
[1236] Step 2:
[1237] The device sends the request and the buggy code to the server. The device sends this data to the server as an HTTP request. Input: Debug request, buggy code. Output: Request to the server.
[1238] Step 3:
[1239] The server receives the debug request and the buggy code and forwards them to the generative AI model. The server sends the received data to the generative AI model in the appropriate format. Input: Debug request, buggy code. Output: Request to the generative AI model.
[1240] Step 4:
[1241] A generative AI model analyzes buggy code and fixes the bug. A generative AI model analyzes the cause of the bug and applies a fix algorithm. Input: Debug request, buggy code. Output: Fixed code.
[1242] Step 5:
[1243] The server returns the corrected code received from the generative AI model to the device. The server receives the response from the generative AI model and sends it to the device as an HTTP response. Input: Corrected code. Output: Response to the device.
[1244] Step 6:
[1245] The terminal displays the modified code to the user. The terminal's user interface displays this modified code. Input: Modified code. Output: Display to user.
[1246] (Application example 1)
[1247] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."
[1248] In conventional factory robot systems, the code required for maintenance and operation is generated, optimized, and debugged manually, resulting in problems of inefficiency and inaccuracy. Furthermore, because the robots themselves lack the ability to perform maintenance tasks autonomously, they face challenges such as high operating costs and long downtime. These issues reduce factory productivity and operational efficiency, undermining competitiveness.
[1249] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.
[1250] In this invention, the server includes means for receiving input from a user, means for sending the input prompt to a generative AI model and generating a code snippet, means for returning the generated code snippet to the user, means for sending a prompt to optimize the received code to the generative AI model and generating optimized code, means for returning the generated optimized code to the user, means for sending buggy code received from the user to the generative AI model and generating debugged code, means for returning the generated debug code to the user, means for generating maintenance work code to assist in robot operation, means for applying the generated maintenance work code to the robot's operation system, and means for optimizing and debugging the code using data from sensors and actuators. This enables the robot to autonomously perform high-quality maintenance work and be operated efficiently.
[1251] "Users" are developers and operators who interact with the system and want to generate, optimize, and debug code.
[1252] A means for receiving "input" is a device or interface through which a user enters prompts or codes, and has the ability to transmit these to the system.
[1253] A "prompt" is a textual input that a user uses to instruct a generative AI model, including instructions for generating a specific code snippet.
[1254] A "generative AI model" is an artificial intelligence model that uses natural language processing techniques to generate code or other output based on prompts.
[1255] A "code snippet" is a portion of program code that is generated to perform a particular task.
[1256] "Optimization" refers to techniques and techniques for improving the performance and efficiency of existing code.
[1257] "Debugging" is a technique for detecting and correcting bugs and errors in existing code.
[1258] A "robot" is a device that operates in a factory and automates manufacturing and maintenance tasks.
[1259] "Maintenance work" refers to calibration, repair, and adjustment work carried out to maintain the performance and lifespan of the robot.
[1260] "Operation system" is a collective term for the hardware and software that controls a robot and allows it to perform specific tasks.
[1261] "Sensor and actuator data" refers to operational data collected from the robot's various sensors (temperature, pressure, position, etc.) and actuators.
[1262] The present invention is a system that generates code snippets based on user-entered prompts, and optimizes and debugs the received code. This system is mainly realized through the interaction of a server, a terminal, and a user.
[1263] System Configuration
[1264] 1. Terminal
[1265] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[1266] 2. Server
[1267] The server performs processing using the following hardware and software.
[1268] Hardware: Cloud or on-premise servers
[1269] software:
[1270] Generative AI models: e.g., GPT-3 and GPT-4
[1271] Data communication: API requests using the HTTP protocol
[1272] The server works with the generative AI model to generate, optimize, and debug code based on prompts, and also generates dedicated maintenance work code and applies it to the robot.
[1273] 3. Users
[1274] Users are developers and operators who operate the system and want to generate, optimize, and debug code.
[1275] Operational procedures and application examples
[1276] Generate code snippets
[1277] When a user wants to generate a code snippet for a specific maintenance task, they enter a prompt into the device, such as "Generate code to calibrate an infrared sensor in Python." The device then sends this prompt to the server, and a generative AI model generates the code snippet based on the prompt.
[1278] Code optimization
[1279] When a user wants to optimize existing maintenance code, they input the original code into the device, for example, in the form of "Please optimize the following code." The device then sends this request to the server, where a generative AI model analyzes the code and performs optimizations to improve performance.
[1280] Debugging bugs
[1281] When a user wants to debug a buggy source code, they input the code into the device, which then sends a debug request to the server, where the generative AI model analyzes the code and fixes the bug.
[1282] Generate and apply maintenance work codes
[1283] To enable the robot to perform self-maintenance, code is generated using a dedicated prompt. For example, enter a prompt such as "Generate code to calibrate the infrared sensor in Python." The generated code is applied to the robot's operating system, allowing it to perform maintenance tasks autonomously.
[1284] By configuring the system in this way and using various hardware and software appropriately, users can efficiently generate, optimize, and debug high-quality code. Furthermore, the robot can autonomously perform maintenance tasks, which is expected to improve operational efficiency.
[1285] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[1286] Step 1:
[1287] The user inputs a prompt into the terminal. Specifically, the user inputs a prompt such as "Please generate code to calibrate the infrared sensor using Python." The input prompt is processed as text data within the terminal.
[1288] Step 2:
[1289] The device sends the prompt entered by the user to the server. Data is transmitted using the HTTP protocol, and the prompt is sent to the server in JSON format. The input data is a prompt sentence, and this data is converted into a request to be sent to the generative AI model.
[1290] Step 3:
[1291] The server sends the received prompt to the generative AI model. The server parses the prompt and sends it as an API request to the generative AI model. The server asks the model to generate a code snippet based on the prompt.
[1292] Step 4:
[1293] The generative AI model generates code snippets based on the prompt. Specifically, the generative AI model uses natural language processing techniques to analyze the prompt and generate the corresponding code snippet. This generation process takes the prompt as data input and provides Python code as text output.
[1294] Step 5:
[1295] The server receives the code snippet returned by the generative AI model and sends it to the device. The code snippet generated on the server is reformatted as text data and sent to the device as an HTTP response.
[1296] Step 6:
[1297] The terminal displays the code snippet received from the server to the user. The terminal parses the data received as an HTTP response and displays the generated code to the user through an appropriate GUI, allowing the user to review the generated code and proceed to the next step if necessary.
[1298] Step 7:
[1299] When a user wants to optimize existing code, they input the original code into the terminal. The user inputs a request such as "Please optimize the following code" and includes the code to be optimized. This input data is used for the next optimization process.
[1300] Step 8:
[1301] The device sends an optimization request to the server. The original code received from the user is sent to the server in JSON format as an optimization request.
[1302] Step 9:
[1303] The server requests the generative AI model to optimize the code. The server sends the received code to the generative AI model and requests the generative AI model to perform optimizations to improve performance.
[1304] Step 10:
[1305] A generative AI model analyzes the code and generates optimized code. The generative AI model uses multiple optimization techniques to improve the performance of the code. The input data is the original code, and the output data is optimized code.
[1306] Step 11:
[1307] The server sends the optimized code to the device, where it is reformatted as text data and sent as an HTTP response to the device.
[1308] Step 12:
[1309] The terminal displays the optimized code received from the server to the user. The terminal analyzes the data received as an HTTP response and displays the optimized code to the user through an appropriate GUI, allowing the user to review the optimized code and proceed to the next step.
[1310] Furthermore, an emotion engine that estimates the user's emotion may be further combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59, and perform identification processing using the user's emotion.
[1311] The present invention provides a system for generating code snippets based on user-entered prompts, and optimizing and debugging the received code. Furthermore, the system's effectiveness is enhanced by incorporating an emotion engine that recognizes the user's emotions and adjusts the generated code and prompts accordingly. The system is specifically implemented as follows:
[1312] System Configuration
[1313] 1. Terminal
[1314] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[1315] 2. Server
[1316] The server is a multi-functional computer system that works with generative AI models to generate, optimize, and debug code based on prompts, and also includes an emotion engine that recognizes user emotions and reflects them in the code generation process.
[1317] 3. Emotion Engine
[1318] The emotion engine analyzes emotions based on user input and other user data, and adjusts the code and optimization prompts output by the generative AI model, reducing user stress and providing a better development experience.
[1319] 4. Users
[1320] Users are developers who operate the system and want to generate, optimize, and debug code.
[1321] Program Description
[1322] Generate code snippets
[1323] When a user wants to generate a code snippet in a specific programming language, they enter a prompt into the terminal, for example, "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server uses an emotion engine to analyze the user's emotion and sends a request to the generative AI model. This request includes the prompt content and adjustments based on the user's emotion. The generative AI model generates a code snippet based on the prompt and sends the result back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[1324] Code optimization
[1325] When a user wants to optimize existing code, they input the original code into the device. For example, they input the code for a binary search algorithm. The device then sends this optimization request to the server. The server uses an emotion engine to analyze the user's emotions and adjusts the optimization prompt based on those emotions. The server then sends the code along with the prompt to a generative AI model, which generates optimized code. The result is then sent back to the server, which then sends the optimized code back to the device, which then displays it to the user.
[1326] Debugging bugs
[1327] If a user wants to debug buggy code, they enter the buggy code into their device—for example, a buggy version of the binary search algorithm mentioned above. The device then sends this debug request to the server. The server uses an emotion engine to analyze the user's emotion and tailors the debug prompt based on that emotion. It then sends the code along with the prompt to a generative AI model, which generates debugged code. The result is then sent back to the server, which then sends the debugged code back to the device, which displays it to the user.
[1328] Specific examples
[1329] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[1330] 1. The user types a prompt into the terminal.
[1331] 2. The terminal sends a prompt to the server.
[1332] 3. The server analyzes the user's emotions using an emotion engine and sends a request to a generative AI model to generate a code snippet.
[1333] 4. The server sends the generated code back to the device.
[1334] 5. The terminal displays the code snippet to the user.
[1335] Optimization and debugging are also performed in a similar manner based on user emotions. For example, if a user enters code saying, "Please optimize the following code," the server analyzes the emotion through the emotion engine and sends an optimization prompt to the generative AI model. The generative AI model then generates optimized code, sends it back to the device via the server, and is ultimately displayed to the user. Bug fixes are also adjusted by the emotion engine, improving user satisfaction.
[1336] This allows users to generate, optimize, and debug code efficiently and with empathy in mind.
[1337] The processing flow will be explained below.
[1338] Generate code snippets
[1339] Step 1:
[1340] A user types a prompt into a terminal indicating that they would like to generate a code snippet in a specific programming language, for example, "Implement a binary search algorithm in Python."
[1341] Step 2:
[1342] The terminal sends this prompt to the server.
[1343] Step 3:
[1344] The server receives the prompt and passes the prompt and user information to the emotion engine to analyze the emotion.
[1345] Step 4:
[1346] The emotion engine analyzes the user's emotions and sends the results back to the server. For example, if the user is feeling stressed, it will return that information.
[1347] Step 5:
[1348] The server adjusts the prompts based on the analysis results of the emotion engine and sends them to the generative AI model.
[1349] Step 6:
[1350] The generative AI model generates code snippets based on the prompts and sends the results back to the server.
[1351] Step 7:
[1352] The server sends the generated code snippet back to the device.
[1353] Step 8:
[1354] The terminal displays the generated code received from the server to the user.
[1355] Code optimization
[1356] Step 1:
[1357] The user enters the original code into the terminal along with a request to optimize the existing code, for example, the code for a binary search algorithm.
[1358] Step 2:
[1359] The device sends this optimization request to the server.
[1360] Step 3:
[1361] The server receives the request and passes the original code and user information to the emotion engine to analyze the emotion.
[1362] Step 4:
[1363] The emotion engine analyzes the user's emotions and sends the results back to the server. For example, if the user is feeling anxious, it will return that information.
[1364] Step 5:
[1365] The server adjusts the optimization prompt based on the analysis results of the emotion engine and sends it to the generative AI model.
[1366] Step 6:
[1367] The generative AI model generates optimized code to improve performance based on the optimization prompts and sends the results back to the server.
[1368] Step 7:
[1369] The server returns the generated optimized code to the terminal.
[1370] Step 8:
[1371] The terminal displays the optimization code received from the server to the user.
[1372] Debugging bugs
[1373] Step 1:
[1374] A user enters buggy code into a terminal along with a request to debug the code, for example, a buggy version of a binary search algorithm.
[1375] Step 2:
[1376] The device sends this debug request to the server.
[1377] Step 3:
[1378] The server receives the request and passes the buggy code and user information to the emotion engine to analyze the emotion.
[1379] Step 4:
[1380] The emotion engine analyzes the user's emotions and sends the results back to the server. For example, if the user is irritated, it will return that information.
[1381] Step 5:
[1382] The server adjusts the debug prompt based on the analysis results of the emotion engine and sends it to the generative AI model.
[1383] Step 6:
[1384] The generative AI model generates code that fixes the bug based on the debug prompts and sends the results back to the server.
[1385] Step 7:
[1386] The server sends the generated debug code back to the device.
[1387] Step 8:
[1388] The terminal displays the debug code received from the server to the user.
[1389] These steps allow users to generate, optimize, and debug code efficiently and with emotion in mind.
[1390] Example 2
[1391] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."
[1392] In conventional code generation systems, users input prompts and the generated code is not always optimized for the user's emotions or situation, which often leads to stress and dissatisfaction. Furthermore, code optimization and debugging must be done manually, making the development process inefficient. As a result, developer productivity is reduced.
[1393] The specific processing by the specific processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means.
[1394] In this invention, the server includes: [means for receiving input from a user; [means for sending the entered prompt to a generative AI model and generating a code snippet; [means for returning the generated code snippet to the user;] [means for sending a prompt for optimizing the received code to a generative AI model and generating optimized code; [means for returning the generated optimized code to the user;] [means for sending buggy code received from the user to a generative AI model and generating debugged code; [means for returning the generated debug code to the user; and] means for analyzing the user's emotions using an emotion engine and adjusting the prompts and generated code based thereon. This makes it possible [to generate, optimize, and debug code according to the user's emotions and needs].
[1395] "User" refers to the developer or programmer who operates the system and requests code generation, optimization, and debugging.
[1396] A "terminal" is a device operated by a user, such as a computer or mobile device, that accepts input, sends requests, and displays results.
[1397] "Server" refers to a high-performance computer system for running the generative AI model and emotion engine, as well as receiving prompts, emotion analysis, code generation, optimization, and debugging.
[1398] A "prompt" is an instruction or request that a user enters into the system, such as a request for code generation, optimization, or debugging.
[1399] "Code snippet" refers to a portion of a program generated by a generative AI model.
[1400] "Generative AI model" refers to an artificial intelligence model used to generate, optimize, and debug code based on user prompts.
[1401] An "emotion engine" refers to a technology that analyzes emotions based on user input and past interactions and reflects the results in a generative AI model.
[1402] "Optimization" refers to the process of making existing code more efficient and performant.
[1403] "Debugging" refers to the process of fixing buggy code so that it works properly.
[1404] The present invention is a system that generates code snippets based on user-entered prompts, and then optimizes and debugs the received code. Furthermore, the system incorporates an emotion engine that recognizes the user's emotions and adjusts the generated code and prompts accordingly, enhancing its effectiveness. The system of the present invention consists of several key components:
[1405] System Components
[1406] 1. Users
[1407] The user is a developer who operates the system and wants to generate code, optimize, and debug it. The user enters prompts and code into a terminal and receives the results.
[1408] 2. Terminal
[1409] A terminal is a device operated by a user that accepts input, displays, and sends requests. Users enter prompts and codes through the terminal. The terminal can be a PC, smartphone, tablet, etc.
[1410] 3. Server
[1411] The server is a multi-functional computer system that works with the generative AI model to generate, optimize, and debug code based on prompts. It also has an emotion engine that recognizes user emotions and reflects them in the code generation process. Specifically, it uses a natural language generation engine (e.g., GPT-3) as the generative AI model and EmotionAPI or similar for the emotion engine.
[1412] 4. Generative AI Models
[1413] Generative AI models are natural language generation engines used to generate, optimize, and debug code based on user prompts, with GPT-3 being an example use case.
[1414] 5. Emotion Engine
[1415] The emotion engine is a technology that analyzes emotions based on user input and past interactions and reflects the results in generative AI models. It uses EmotionAPI to analyze user emotions.
[1416] Explanation of program processing
[1417] Generate code snippets
[1418] When a user wants to generate a code snippet in a specific programming language, they enter a prompt into their device: "Implement a binary search algorithm in Python." The device then sends this prompt to the server. The server uses an emotion engine to analyze the user's emotion and sends the analysis result and the prompt to the generative AI model. The generative AI model uses this information to generate a code snippet and sends it back to the server. The server then sends the generated code snippet back to the device, which then displays it to the user.
[1419] Code optimization
[1420] When a user wants to optimize existing code, they input the original code into their device. For example, they input the code for a binary search algorithm. The device then sends this optimization request to the server. The server uses an emotion engine to analyze the user's emotions and sends the analysis results and the original code as an optimization prompt to the generative AI model. The generative AI model generates optimized code and sends it back to the server. The server then sends the optimized code back to the device, which displays it to the user.
[1421] Debugging bugs
[1422] When a user wants to debug buggy code, they input the buggy code into their device. For example, they input the code for a buggy binary search algorithm. The device then sends this debug request to the server. The server uses an emotion engine to analyze the user's emotions and sends the analysis result and the buggy code as a debug prompt to the generative AI model. The generative AI model generates debugged code and sends it back to the server. The server then sends the debugged code back to the device, which then displays it to the user.
[1423] Specific examples
[1424] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[1425] 1. The user types a prompt into the terminal.
[1426] 2. The terminal sends a prompt to the server.
[1427] 3. The server analyzes the user's emotions using an emotion engine and sends a request to a generative AI model to generate a code snippet.
[1428] 4. The server sends the generated code snippet back to the device.
[1429] 5. The terminal displays the code snippet to the user.
[1430] Optimization and debugging are also performed in a similar manner based on user emotions. For example, if a user enters code saying, "Please optimize the following code," the server analyzes the emotion through the emotion engine and sends an optimization prompt to the generative AI model. The generative AI model then generates optimized code, sends it back to the device via the server, and is ultimately displayed to the user. Bug fixes are also adjusted by the emotion engine, improving user satisfaction.
[1431] As described above, the present invention allows users to generate, optimize, and debug code efficiently while taking emotions into account.
[1432] The flow of the identification process in the second embodiment will be described with reference to FIG.
[1433] Generate code snippets
[1434] Step 1:
[1435] If a user wants to generate a code snippet in a specific programming language, they can type the prompt "Implement a binary search algorithm in Python" into the terminal.
[1436] Input: Prompt statement "Implement a binary search algorithm in Python"
[1437] Output: The prompt the user types into the terminal
[1438] Step 2:
[1439] The terminal sends the entered prompt to the server.
[1440] Input: The prompt received from the user
[1441] Data processing: Convert the prompt text into a format that can be sent to the server as an HTTP request
[1442] Output: Prompt text sent to the server
[1443] Step 3:
[1444] The server uses an emotion engine to analyze the user's emotions.
[1445] Input: The prompt sent to the server and the user's previous input data
[1446] Data calculation: Sentiment analysis using sentiment analysis tools such as EmotionAPI
[1447] Output: Sentiment analysis results (e.g., stress level, satisfaction, etc.)
[1448] Step 4:
[1449] The server sends the emotion analysis results and prompt sentence as a request to the generative AI model.
[1450] Input: prompt and sentiment analysis results
[1451] Data processing: shaping data into a format that can be fed into a generative AI model
[1452] Output: The request sent to the generative AI model
[1453] Step 5:
[1454] The generative AI model generates a code snippet based on the prompt text and sentiment analysis results and sends it back to the server.
[1455] Input: The request sent by the server
[1456] Data Calculation: Code generation based on prompt sentences and sentiment analysis results
[1457] Output: Generated code snippet
[1458] Step 6:
[1459] The server sends the generated code snippet back to the device.
[1460] Input: Code snippet received from the generative AI model
[1461] Data processing: Converting data into a format that can be sent back to the device as an HTTP response
[1462] Output: Code snippet sent to the terminal
[1463] Step 7:
[1464] The terminal displays the code snippet to the user.
[1465] Input: Code snippet received from the server
[1466] Data processing: Display in a visually understandable format for users
[1467] Output: The code snippet displayed to the user
[1468] Code optimization
[1469] Step 1:
[1470] The user enters into the terminal the existing code they wish to optimize, for example the code for a binary search algorithm.
[1471] Input: Original code
[1472] Output: The original code that the user entered into the terminal
[1473] Step 2:
[1474] The device sends an optimization request to the server.
[1475] Input: The code received from the user
[1476] Data processing: Converting data into a format to be sent to the server as an HTTP request
[1477] Output: The code sent to the server
[1478] Step 3:
[1479] The server uses an emotion engine to analyze the user's emotions.
[1480] Input: The code sent to the server and any previous inputs from the user
[1481] Data calculation: Sentiment analysis using sentiment analysis tools such as EmotionAPI
[1482] Output: Emotion analysis results
[1483] Step 4:
[1484] The server sends the sentiment analysis results and the original code as a request to the generated AI model.
[1485] Input: Original code and sentiment analysis results
[1486] Data processing: shaping data into a format that can be fed into a generative AI model
[1487] Output: The request sent to the generative AI model
[1488] Step 5:
[1489] The generative AI model generates optimized code based on the original code and sends it back to the server.
[1490] Input: The request sent by the server
[1491] Data calculation: Optimization process based on the original code and sentiment analysis results
[1492] Output: Optimized code
[1493] Step 6:
[1494] The server sends the optimized code back to the device.
[1495] Input: Optimized code received from a generative AI model
[1496] Data processing: Converting data into a format that can be sent back to the device as an HTTP response
[1497] Output: Optimized code sent to the terminal
[1498] Step 7:
[1499] The terminal displays the optimized code to the user.
[1500] Input: Optimized code received from the server
[1501] Data processing: Display in a visually understandable format for users
[1502] Output: The optimized code displayed to the user
[1503] Debugging bugs
[1504] Step 1:
[1505] The user types into the terminal the buggy code they want to debug, for example the code for a buggy binary search algorithm.
[1506] Input: Buggy code
[1507] Output: The buggy code as entered by the user into the terminal
[1508] Step 2:
[1509] The device sends a debug request to the server.
[1510] Input: Buggy code received from the user
[1511] Data processing: Converting data into a format to be sent to the server as an HTTP request
[1512] Output: The buggy code sent to the server
[1513] Step 3:
[1514] The server uses an emotion engine to analyze the user's emotions.
[1515] Input: The buggy code sent to the server and the user's previous input data
[1516] Data calculation: Sentiment analysis using sentiment analysis tools such as EmotionAPI
[1517] Output: Emotion analysis results
[1518] Step 4:
[1519] The server sends the sentiment analysis results and the buggy code as a request to the generated AI model.
[1520] Input: Buggy code and sentiment analysis results
[1521] Data processing: shaping data into a format that can be fed into a generative AI model
[1522] Output: The request sent to the generative AI model
[1523] Step 5:
[1524] The generative AI model generates debugged code based on the buggy code and sends it back to the server.
[1525] Input: The request sent by the server
[1526] Data calculation: Debugging process based on buggy code and sentiment analysis results
[1527] Output: Debugged code
[1528] Step 6:
[1529] The server sends the debugged code back to the device.
[1530] Input: Debugged code received from the generative AI model
[1531] Data processing: Converting data into a format that can be sent back to the device as an HTTP response
[1532] Output: Debugged code sent to the terminal
[1533] Step 7:
[1534] The terminal displays the debugged code to the user.
[1535] Input: The debugged code received from the server
[1536] Data processing: Display in a visually understandable format for users
[1537] Output: The debugged code displayed to the user
[1538] (Application example 2)
[1539] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the headset type terminal 314 will be referred to as a "terminal."
[1540] Managing robot operations efficiently and safely is a key challenge for factory robot control systems. However, currently, generating, optimizing, and debugging robot program code requires a significant amount of time and expertise. In particular, when a problem occurs in the robot's control code, it is difficult to quickly debug it, significantly impacting productivity. Furthermore, the emotional state of the operator can lead to stress and reduced work efficiency. To address these issues, a system is needed that takes into account the operator's emotions while automating robot program code management.
[1541] The specific processing by the specific processing unit 290 of the data processing device 12 in Application Example 2 is realized by the following means. In this invention, the server includes means for receiving input from a user, means for sending the input prompt to the generative AI model and generating a code snippet, means for returning the generated code snippet to the user, means for sending a prompt for optimizing the received code to the generative AI model and generating optimized code, means for returning the generated optimized code to the user, means for sending buggy code received from the user to the generative AI model and generating debugged code, means for returning the generated debug code to the user, means for analyzing user emotions using an emotion engine and adjusting the prompts and generated code, and means for being incorporated into a robot control system in a factory and performing code generation, optimization, and debugging to improve robot work efficiency. This automates the generation, optimization, and debugging of robot control code, enabling efficient work that takes operator emotions into consideration.
[1542] "Means for receiving input from a user" refers to a function that receives prompts or codes entered by a user through a terminal.
[1543] "Means for sending an input prompt to a generative AI model and generating a code snippet" refers to a function that sends a prompt entered by a user to a generative AI model and generates specific code based on the prompt.
[1544] The "means for returning the generated code snippet to the user" is a function for returning and displaying the code snippet generated by the generative AI model to the user.
[1545] "Means for sending prompts to optimize the received code to a generative AI model and generating optimized code" refers to a function for sending prompts to optimize existing code entered by a user to a generative AI model, thereby generating optimized code.
[1546] The "means for returning the generated optimized code to the user" is a function for returning the optimized code to the user and displaying it.
[1547] The "means for sending buggy code received from a user to a generative AI model and generating debugged code" refers to a function for sending buggy code entered by a user to a generative AI model and generating debugged code based on the prompts.
[1548] The "means for returning generated debug code to the user" is a function for returning the debugged code to the user and displaying it.
[1549] "Means for analyzing the user's emotions using an emotion engine and adjusting the prompts and generated codes" is a function that uses an emotion engine that analyzes the user's emotions to provide the optimal prompts and codes according to the user's emotional state.
[1550] "A means for being incorporated into the robot control system within a factory and for generating, optimizing, and debugging code to improve the work efficiency of the robot" refers to a function incorporated into the system that controls the robot within a factory, which generates, optimizes, and debugs the code required to improve the work efficiency of the robot.
[1551] This invention relates to a system that utilizes a generative AI model and an emotion engine to realize code generation, optimization, and debugging for a robot control system in a factory. This system is configured as follows to efficiently manage robot programs while taking into account the user's emotions.
[1552] System Configuration
[1553] 1. Terminal
[1554] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[1555] 2. Server
[1556] The server is a multi-functional computer system that works with generative AI models to generate, optimize, and debug code based on prompts, and also includes an emotion engine that recognizes user emotions and reflects them in the code generation process.
[1557] 3. Emotion Engine
[1558] The emotion engine analyzes emotions based on user input and other user data and adjusts the code and prompts output by the generative AI model, reducing user stress and providing a better development experience.
[1559] 4. Users
[1560] A user is a person who operates the system and wants to generate, optimize, and debug code.
[1561] Program Description
[1562] Generate code snippets
[1563] When a user wants to generate robot control code for a specific task, they enter a prompt into the terminal, for example, "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server uses an emotion engine to analyze the user's emotion and sends a request to the generative AI model. This request includes the prompt content and adjustments based on the user's emotion. The generative AI model generates a code snippet based on the prompt and sends the result back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[1564] Code optimization
[1565] When a user wants to optimize existing robot control code, they input the original code into the device. For example, they input the code for a binary search algorithm. The device then sends this optimization request to the server. The server uses an emotion engine to analyze the user's emotions and adjusts the optimization prompt based on those emotions. It then sends the code along with the prompt to a generative AI model, which generates optimized code. The result is then sent back to the server, which then sends the optimized code back to the device, which displays it to the user.
[1566] Debugging bugs
[1567] If a user wants to debug buggy code, they enter the buggy code into their device—for example, a buggy version of the binary search algorithm mentioned above. The device then sends this debug request to the server. The server uses an emotion engine to analyze the user's emotion and tailors the debug prompt based on that emotion. It then sends the code along with the prompt to a generative AI model, which generates debugged code. The result is then sent back to the server, which then sends the debugged code back to the device, which displays it to the user.
[1568] Specific examples
[1569] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[1570] 1. The user types a prompt into the terminal.
[1571] 2. The terminal sends a prompt to the server.
[1572] 3. The server analyzes the user's emotions using an emotion engine and sends a request to a generative AI model to generate a code snippet.
[1573] 4. The server sends the generated code back to the device.
[1574] 5. The terminal displays the code snippet to the user.
[1575] The hardware used in this process includes terminals and servers, and the software uses generative AI models and emotion engines. A specific example of use is "Please optimize the following Python code."
[1576] Please optimize the following Python code:
[1577] code:
[1578] def binary_search(arr, target):
[1579] left, right = 0, len(arr) - 1
[1580] while left <= right:
[1581] mid = (left + right) / / 2
[1582] if arr[mid] == target:
[1583] return mid
[1584] elif arr[mid] < target:
[1585] left = mid + 1
[1586] else:
[1587] right = mid - 1
[1588] return -1
[1589] This allows users to generate, optimize, and debug code efficiently and with consideration for emotions.
[1590] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[1591] Step 1:
[1592] The user uses the terminal to input prompts or code, which can include prompt statements such as "Implement a binary search algorithm in Python" or existing code. The input data is received by the terminal.
[1593] Step 2:
[1594] The device then sends the received prompt or code to the server, which then appropriately formats the input and sends it as data.
[1595] Step 3:
[1596] The server uses an emotion engine to analyze the user's emotions, based on the user's input data, past usage history, etc. The emotion engine analyzes the user's emotional state and adjusts the prompts and generated code based on that data.
[1597] Step 4:
[1598] Based on the user's emotional data analyzed by the emotion engine, the server requests the generative AI model to send prompts and generate code, including adjusting the prompts according to the user's emotions.
[1599] Step 5:
[1600] The generative AI model generates code snippets based on the prompt it receives, for example, "Implement a binary search algorithm in Python," and generates the appropriate Python code. The generated code snippets are then sent back to the server.
[1601] Step 6:
[1602] The server returns the generated code to the device. If any adjustments have been made by the emotion engine, the code that reflects the adjustments is returned.
[1603] Step 7:
[1604] The terminal displays the generated code received from the server to the user, allowing the user to confirm the generated code.
[1605] Step 8:
[1606] If a user wants to optimize an existing code, they input the existing code along with an optimization request into the terminal, for example, "Please optimize the following code" and the original code. The terminal then sends this request and the code to the server.
[1607] Step 9:
[1608] When the server sends an optimization request to the generative AI model, it analyzes the user's emotions using an emotion engine and adjusts the optimization prompt based on the results.
[1609] Step 10:
[1610] The generative AI model optimizes the code based on the tailored prompts and sends the optimized code back to the server.
[1611] Step 11:
[1612] The server returns the optimized code to the terminal, which displays it to the user, who can then view the optimized code.
[1613] Step 12:
[1614] When a user wants to debug buggy code, they enter the buggy code into the terminal along with a debug request, which the terminal sends to the server.
[1615] Step 13:
[1616] When the server sends a debug request to the generative AI model, it analyzes the user's emotions with an emotion engine and adjusts the debug prompt based on the results.
[1617] Step 14:
[1618] The generative AI model performs the debugging tasks based on the tailored prompts and sends the debugged code back to the server.
[1619] Step 15:
[1620] The server sends the debugged code back to the terminal, which displays it to the user, who can then view the debugged code.
[1621] Through these processing steps, the system of the present invention enables the generation, optimization, and debugging of robot control code in an efficient and emotionally sensitive manner.
[1622] The specific processing unit 290 transmits the result of the specific processing to the headset type terminal 314. In the headset type terminal 314, the control unit 46A causes the speaker 240 and the display 343 to output the result of the specific processing. The microphone 238 acquires audio indicating a user input regarding the result of the specific processing. The control unit 46A transmits audio data indicating the user input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the audio data.
[1623] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (Internet Search<URL: https: / / openai.com / blog / chatgpt> ), Gemini (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.
[1624] In the above embodiment, an example was given in which the specific processing is performed by the data processing device 12, but the technology of the present disclosure is not limited to this, and the specific processing may be performed by the headset type terminal 314.
[1625] [Fourth embodiment]
[1626] FIG. 7 shows an example of the configuration of a data processing system 410 according to the fourth embodiment.
[1627] 7, a data processing system 410 includes a data processing device 12 and a robot 414. An example of the data processing device 12 is a server.
[1628] The data processing device 12 includes a computer 22, a database 24, and a communication I / F 26. The computer 22 is an example of a "computer" according to the technology of the present disclosure. The computer 22 includes a processor 28, a RAM 30, and a storage 32. The processor 28, the RAM 30, and the storage 32 are connected to a bus 34. The database 24 and the communication I / F 26 are also connected to the bus 34. The communication I / F 26 is connected to a network 54. Examples of the network 54 include a WAN (Wide Area Network) and / or a LAN (Local Area Network).
[1629] The robot 414 includes a computer 36, a microphone 238, a speaker 240, a camera 42, a communication I / F 44, and a control target 443. The computer 36 includes a processor 46, a RAM 48, and a storage 50. The processor 46, the RAM 48, and the storage 50 are connected to a bus 52. The microphone 238, the speaker 240, the camera 42, and the control target 443 are also connected to the bus 52.
[1630] The microphone 238 receives instructions and the like from the user 20 by receiving voice uttered by the user 20. The microphone 238 captures the voice uttered by the user 20, converts the captured voice into audio data, and outputs it to the processor 46. The speaker 240 outputs audio in accordance with instructions from the processor 46.
[1631] Camera 42 is a small digital camera equipped with an optical system including a lens, aperture, and shutter, and an imaging element such as a CMOS (Complementary Metal-Oxide-Semiconductor) image sensor or a CCD (Charge Coupled Device) image sensor, and captures images of the surroundings of user 20 (for example, an imaging range defined by an angle of view equivalent to the field of vision of a typical healthy person).
[1632] The communication I / F 44 is connected to a network 54. The communication I / Fs 44 and 26 control the exchange of various information between the processor 46 and the processor 28 via the network 54. The exchange of various information between the processor 46 and the processor 28 using the communication I / Fs 44 and 26 is carried out in a secure state.
[1633] The control object 443 includes a display device, LEDs in the eyes, and motors for driving the arms, hands, and feet. The posture and gestures of the robot 414 are controlled by controlling the motors of the arms, hands, and feet. Some of the emotions of the robot 414 can be expressed by controlling these motors. In addition, the facial expressions of the robot 414 can also be expressed by controlling the light emission state of the LEDs in the eyes of the robot 414.
[1634] Fig. 8 shows an example of the main functions of the data processing device 12 and the robot 414. As shown in Fig. 8, in the data processing device 12, a specific process is performed by the processor 28. A specific process program 56 is stored in the storage 32.
[1635] The specific processing program 56 is an example of a "program" according to the technology of the present disclosure. The processor 28 reads the specific processing program 56 from the storage 32 and executes the read specific processing program 56 on the RAM 30. The specific processing is realized by the processor 28 operating as a specific processing unit 290 in accordance with the specific processing program 56 executed on the RAM 30.
[1636] The storage 32 stores a data generation model 58 and an emotion identification model 59. The data generation model 58 and the emotion identification model 59 are used by the identification processing unit 290.
[1637] In the robot 414, the processor 46 performs the reception output process. A reception output program 60 is stored in the storage 50. The processor 46 reads the reception output program 60 from the storage 50 and executes the read reception output program 60 on the RAM 48. The reception output process is realized by the processor 46 operating as the control unit 46A in accordance with the reception output program 60 executed on the RAM 48.
[1638] Next, a description will be given of the specific processing performed by the specific processing unit 290 of the data processing device 12. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1639] The present invention is a system that generates code snippets based on prompts entered by a user, and further optimizes and debugs the received code. The system is mainly realized through the interaction of a server, a terminal, and a user.
[1640] System Configuration
[1641] 1. Terminal
[1642] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[1643] 2. Server
[1644] The server is a multi-function computer system that works in conjunction with generative AI models to perform prompt-based code generation, optimization, and debugging.
[1645] 3. Users
[1646] Users are developers who operate the system and want to generate, optimize, and debug code.
[1647] Program Description
[1648] Generate code snippets
[1649] When a user wants to generate a code snippet in a particular programming language, they enter a prompt into the terminal, such as "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server receives the prompt and sends a request to the generative AI model. The generative AI model generates a code snippet based on the prompt and sends it back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[1650] Code optimization
[1651] When a user wants to optimize existing code, they input the original code into their device. This optimization request is sent to the server, which then asks a generative AI model to optimize the code. The generative AI model analyzes the code, performs optimizations to improve performance, and sends the result back to the server. The server then sends the optimized code back to the device, which displays it to the user.
[1652] Debugging bugs
[1653] When a user wants to debug a buggy piece of code, they input the code into their device. The device then sends a debug request to the server. The server then asks the generative AI model to fix the bug, which then analyzes the code and fixes the bug. The corrected code is sent back to the server, which then sends it back to the device. Finally, the device displays the corrected debug code to the user.
[1654] Specific examples
[1655] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[1656] 1. The user types a prompt into the terminal.
[1657] 2. The terminal sends a prompt to the server.
[1658] 3. The server sends a request to the generative AI model to generate a code snippet.
[1659] 4. The server sends the generated code back to the device.
[1660] 5. The terminal displays the code snippet to the user.
[1661] A similar process is used for optimizing and debugging code. For example, if a user inputs code, such as "Please optimize the following code," the server sends the request to the generative AI model, which generates the optimized code and sends it back to the device, which then displays it to the user. Similarly, when debugging bugs, the server sends the buggy code to the generative AI model and requests a fix, after which the fixed code is provided to the user via the device.
[1662] This allows users to efficiently generate, optimize, and debug high-quality code.
[1663] The processing flow will be explained below.
[1664] Generate code snippets
[1665] Step 1:
[1666] If a user wants to generate a code snippet in a particular programming language, they type a prompt into the terminal, for example, "Implement a binary search algorithm in Python."
[1667] Step 2:
[1668] The terminal receives the user's input and sends the prompts to the server.
[1669] Step 3:
[1670] The server parses the received prompt and sends a request to the generative AI model, which includes the prompt content and requirements for the code to be generated.
[1671] Step 4:
[1672] The generative AI model generates the appropriate code snippet based on the prompts received and sends the results back to the server.
[1673] Step 5:
[1674] The server receives the generated code snippet and sends it back to the device.
[1675] Step 6:
[1676] The terminal displays the generated code received from the server to the user.
[1677] Code optimization
[1678] Step 1:
[1679] If a user wants to optimize existing code, they input the original code they want to optimize into the terminal, for example, the code for a binary search algorithm.
[1680] Step 2:
[1681] The terminal receives the user's input and sends the optimization request to the server.
[1682] Step 3:
[1683] The server analyzes the received original code and sends an optimization request to the generative AI model, which includes the content of the original code and instructions for optimization.
[1684] Step 4:
[1685] Based on the original code it receives, the generative AI model generates optimized code that improves performance and efficiency, and sends the results back to the server.
[1686] Step 5:
[1687] The server receives the generated optimized code and returns it to the terminal.
[1688] Step 6:
[1689] The terminal displays the optimization code received from the server to the user.
[1690] Debugging bugs
[1691] Step 1:
[1692] If a user wants to debug buggy code, they enter the buggy code into the terminal, for example, a buggy version of the binary search algorithm mentioned above.
[1693] Step 2:
[1694] The terminal receives the user's input and sends the debug request to the server.
[1695] Step 3:
[1696] The server analyzes the received buggy code and sends a debug request to the generative AI model, which includes the contents of the buggy code and instructions for debugging.
[1697] Step 4:
[1698] Based on the buggy code it receives, the generative AI model generates debugged code that fixes the bug and sends the results back to the server.
[1699] Step 5:
[1700] The server receives the generated debug code and sends it back to the device.
[1701] Step 6:
[1702] The terminal displays the debugged code received from the server to the user.
[1703] These steps allow the user to efficiently generate, optimize, and debug code.
[1704] Example 1
[1705] Next, a description will be given of Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1706] Conventional systems make it difficult for users to efficiently generate, optimize, and debug program code. In particular, there were issues with the quality of the generated code, the accuracy of optimization, and the accuracy of bug fixes. Furthermore, there was no system that automatically executed corresponding actions based on the prompts and code entered by the user, providing quick results. This could result in reduced developer productivity, leading to project delays and a decline in quality.
[1707] The specific processing by the specific processing unit 290 of the data processing device 12 in the first embodiment is realized by the following means.
[1708] In this invention, the server includes: [means for receiving input from a user]; [means for sending the entered prompt to a generative AI model and generating a code snippet]; [means for returning the generated code snippet to the user]; [means for sending a prompt for optimizing the received code to a generative AI model and generating optimized code]; [means for returning the generated optimized code to the user]; [means for sending buggy code received from the user to a generative AI model and generating debugged code]; [means for returning the generated debug code to the user]; and [means for displaying the code snippet, optimized code, and debug code generated by the generative AI model. This enables users to efficiently generate, optimize, and debug high-quality code.
[1709] "Users" are the people who operate the system and provide input, and developers who request code generation, optimization, and debugging.
[1710] A "terminal" is a device operated by a user, which accepts and displays input and sends requests to a server.
[1711] The "server" is a computer system that works in conjunction with the generative AI model to generate, optimize, and debug code based on prompts.
[1712] A "prompt" is an instruction that a user enters to request a particular action from the system, such as "Please implement a binary search algorithm in Python."
[1713] A "generative AI model" is an artificial intelligence model that generates code snippets based on user-entered prompts and also optimizes and debugs the received code.
[1714] "Code snippet generation means" refers to a function on the server that sends a prompt to a generation AI model and generates a code snippet.
[1715] "Optimization means" refers to a function that sends prompts to the generative AI model to optimize the code received at the server, and generates optimized code.
[1716] "Debugging means" refers to a function that sends buggy code received from a user to a generation AI model on the server and generates debugged code.
[1717] "Display means" refers to a function that displays to the user the code snippets, optimized code, and debugged code generated by the generative AI model.
[1718] The present invention is a system for generating code snippets based on user prompts, and optimizing and debugging the received code. This system is implemented primarily through the interaction of a server, a terminal, and a user.
[1719] System Configuration
[1720] 1. Terminal
[1721] A terminal is a device operated by a user that accepts input, displays, and transmits requests. A user enters prompts or codes through a terminal. For example, devices that can be used as terminals include PCs, tablets, and smartphones.
[1722] 2. Server
[1723] The server is a multi-function computer system that works in conjunction with a generative AI model, such as the well-known GPT-4, to generate code based on prompts, optimize it, and debug it.
[1724] 3. Users
[1725] The user is a developer who operates the system and wants to generate, optimize, and debug code. The user uses a terminal to enter prompts.
[1726] Program Description
[1727] Generate code snippets
[1728] First, when a user wants to generate a code snippet in a specific programming language, they enter a prompt into the terminal. This prompt might be something like "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server receives the prompt and sends a request to the generative AI model. The generative AI model generates a code snippet based on the prompt and sends it back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[1729] Specific examples
[1730] For example, a user types the prompt "Implement a binary search algorithm in Python" into a terminal. The terminal sends this prompt to a server, which then makes a request to a generative AI model. The generative AI model generates a code snippet and sends it back to the server. The server sends the code snippet to the terminal, which displays it to the user.
[1731] Code optimization
[1732] When a user wants to optimize existing code, they input the original code into their device. This optimization request is sent to the server, which then asks a generative AI model to optimize the code. The generative AI model analyzes the code, performs optimizations to improve performance, and sends the result back to the server. The server then sends the optimized code back to the device, which displays it to the user.
[1733] Specific examples
[1734] If a user types in code like "Please optimize the following Python code," the device sends the request and code to the server, which sends the request to a generative AI model, which generates the optimized code and sends it back to the device, which then displays it to the user.
[1735] Debugging bugs
[1736] When a user wants to debug a buggy piece of code, they input the code into their device. The device then sends a debug request to the server. The server then asks the generative AI model to fix the bug, which then analyzes the code and fixes the bug. The corrected code is sent back to the server, which then sends it back to the device. Finally, the device displays the corrected debug code to the user.
[1737] Specific examples
[1738] If a user inputs a buggy code such as "Please fix the bug in the Python code below," the device sends the request and the code to the server, which sends the request to the generative AI model, which generates the corrected code and sends it back to the device, which displays it to the user.
[1739] The above process allows users to efficiently generate, optimize, and debug high-quality code. This system is realized through the cooperation of servers, terminals, and generative AI models.
[1740] The flow of the identification process in the first embodiment will be described with reference to FIG.
[1741] Program processing flow
[1742] Generate code snippets
[1743] Step 1:
[1744] The user enters a prompt into the terminal. The user enters a prompt sentence such as "Implement a binary search algorithm in Python" into the input field of the terminal. This prepares the terminal to send the prompt sentence to the system.
[1745] Step 2:
[1746] The terminal receives the input prompt text and sends it to the server. Specifically, the terminal sends the prompt text as an HTTP request to the server's API endpoint. Input: Prompt text. Output: Request to the server.
[1747] Step 3:
[1748] The server receives the prompt and forwards it to the generative AI model. The server's internal logic parses the prompt and sends a request to the generative AI model. Input: Prompt. Output: Request to the generative AI model.
[1749] Step 4:
[1750] The generative AI model generates a code snippet based on the received prompt. The generative AI model analyzes the prompt and runs an algorithm to generate the appropriate code. Input: Prompt. Output: Generated code snippet.
[1751] Step 5:
[1752] The server returns the code snippet received from the generative AI model to the device. The server receives the response from the generative AI model and sends it to the device as an HTTP response. Input: Generated code snippet. Output: Response to the device.
[1753] Step 6:
[1754] The terminal displays the generated code snippet to the user. Specifically, the terminal's user interface displays this code in a text area. Input: Generated code snippet. Output: Displayed to the user.
[1755] Code optimization
[1756] Step 1:
[1757] The user inputs the code they want to optimize and their request into the terminal. The user inputs "Please optimize this Python code" and the original code. Input: Optimization request and original code.
[1758] Step 2:
[1759] The device sends the request and original code to the server. The device sends this data to the server as an HTTP request. Input: Optimized request, original code. Output: Request to the server.
[1760] Step 3:
[1761] The server receives the optimization request and the original code and forwards them to the generative AI model. The server sends the received data to the generative AI model in the appropriate format. Input: Optimization request, original code. Output: Request to the generative AI model.
[1762] Step 4:
[1763] A generative AI model analyzes the original code and generates optimized code. The generative AI model applies optimization algorithms to improve performance. Input: Optimization request, original code. Output: Optimized code.
[1764] Step 5:
[1765] The server returns the optimized code received from the generative AI model to the device. The server receives the response from the generative AI model and sends it to the device as an HTTP response. Input: Optimized code. Output: Response to the device.
[1766] Step 6:
[1767] The terminal displays the optimized code to the user. The terminal's user interface displays this optimized code. Input: Optimized code. Output: Display to user.
[1768] Debugging bugs
[1769] Step 1:
[1770] User types buggy code and a debug request into the terminal. User types "Please fix the bug in this Python code" and the buggy code. Input: Debug request and buggy code.
[1771] Step 2:
[1772] The device sends the request and the buggy code to the server. The device sends this data to the server as an HTTP request. Input: Debug request, buggy code. Output: Request to the server.
[1773] Step 3:
[1774] The server receives the debug request and the buggy code and forwards them to the generative AI model. The server sends the received data to the generative AI model in the appropriate format. Input: Debug request, buggy code. Output: Request to the generative AI model.
[1775] Step 4:
[1776] A generative AI model analyzes buggy code and fixes the bug. A generative AI model analyzes the cause of the bug and applies a fix algorithm. Input: Debug request, buggy code. Output: Fixed code.
[1777] Step 5:
[1778] The server returns the corrected code received from the generative AI model to the device. The server receives the response from the generative AI model and sends it to the device as an HTTP response. Input: Corrected code. Output: Response to the device.
[1779] Step 6:
[1780] The terminal displays the modified code to the user. The terminal's user interface displays this modified code. Input: Modified code. Output: Display to user.
[1781] (Application example 1)
[1782] Next, a description will be given of Application Example 1. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1783] In conventional factory robot systems, the code required for maintenance and operation is generated, optimized, and debugged manually, resulting in problems of inefficiency and inaccuracy. Furthermore, because the robots themselves lack the ability to perform maintenance tasks autonomously, they face challenges such as high operating costs and long downtime. These issues reduce factory productivity and operational efficiency, undermining competitiveness.
[1784] The specific processing by the specific processing unit 290 of the data processing device 12 in the application example 1 is realized by the following means.
[1785] In this invention, the server includes means for receiving input from a user, means for sending the input prompt to a generative AI model and generating a code snippet, means for returning the generated code snippet to the user, means for sending a prompt to optimize the received code to the generative AI model and generating optimized code, means for returning the generated optimized code to the user, means for sending buggy code received from the user to the generative AI model and generating debugged code, means for returning the generated debug code to the user, means for generating maintenance work code to assist in robot operation, means for applying the generated maintenance work code to the robot's operation system, and means for optimizing and debugging the code using data from sensors and actuators. This enables the robot to autonomously perform high-quality maintenance work and be operated efficiently.
[1786] "Users" are developers and operators who interact with the system and want to generate, optimize, and debug code.
[1787] A means for receiving "input" is a device or interface through which a user enters prompts or codes, and has the ability to transmit these to the system.
[1788] A "prompt" is a textual input that a user uses to instruct a generative AI model, including instructions for generating a specific code snippet.
[1789] A "generative AI model" is an artificial intelligence model that uses natural language processing techniques to generate code or other output based on prompts.
[1790] A "code snippet" is a portion of program code that is generated to perform a particular task.
[1791] "Optimization" refers to techniques and techniques for improving the performance and efficiency of existing code.
[1792] "Debugging" is a technique for detecting and correcting bugs and errors in existing code.
[1793] A "robot" is a device that operates in a factory and automates manufacturing and maintenance tasks.
[1794] "Maintenance work" refers to calibration, repair, and adjustment work carried out to maintain the performance and lifespan of the robot.
[1795] "Operation system" is a collective term for the hardware and software that controls a robot and allows it to perform specific tasks.
[1796] "Sensor and actuator data" refers to operational data collected from the robot's various sensors (temperature, pressure, position, etc.) and actuators.
[1797] The present invention is a system that generates code snippets based on user-entered prompts, and optimizes and debugs the received code. This system is mainly realized through the interaction of a server, a terminal, and a user.
[1798] System Configuration
[1799] 1. Terminal
[1800] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[1801] 2. Server
[1802] The server performs processing using the following hardware and software.
[1803] Hardware: Cloud or on-premise servers
[1804] software:
[1805] Generative AI models: e.g., GPT-3 and GPT-4
[1806] Data communication: API requests using the HTTP protocol
[1807] The server works with the generative AI model to generate, optimize, and debug code based on prompts, and also generates dedicated maintenance work code and applies it to the robot.
[1808] 3. Users
[1809] Users are developers and operators who operate the system and want to generate, optimize, and debug code.
[1810] Operational procedures and application examples
[1811] Generate code snippets
[1812] When a user wants to generate a code snippet for a specific maintenance task, they enter a prompt into the device, such as "Generate code to calibrate an infrared sensor in Python." The device then sends this prompt to the server, and a generative AI model generates the code snippet based on the prompt.
[1813] Code optimization
[1814] When a user wants to optimize existing maintenance code, they input the original code into the device, for example, in the form of "Please optimize the following code." The device then sends this request to the server, where a generative AI model analyzes the code and performs optimizations to improve performance.
[1815] Debugging bugs
[1816] When a user wants to debug a buggy source code, they input the code into the device, which then sends a debug request to the server, where the generative AI model analyzes the code and fixes the bug.
[1817] Generate and apply maintenance work codes
[1818] To enable the robot to perform self-maintenance, code is generated using a dedicated prompt. For example, enter a prompt such as "Generate code to calibrate the infrared sensor in Python." The generated code is applied to the robot's operating system, allowing it to perform maintenance tasks autonomously.
[1819] By configuring the system in this way and using various hardware and software appropriately, users can efficiently generate, optimize, and debug high-quality code. Furthermore, the robot can autonomously perform maintenance tasks, which is expected to improve operational efficiency.
[1820] The flow of the specific processing in the application example 1 will be described with reference to FIG.
[1821] Step 1:
[1822] The user inputs a prompt into the terminal. Specifically, the user inputs a prompt such as "Please generate code to calibrate the infrared sensor using Python." The input prompt is processed as text data within the terminal.
[1823] Step 2:
[1824] The device sends the prompt entered by the user to the server. Data is transmitted using the HTTP protocol, and the prompt is sent to the server in JSON format. The input data is a prompt sentence, and this data is converted into a request to be sent to the generative AI model.
[1825] Step 3:
[1826] The server sends the received prompt to the generative AI model. The server parses the prompt and sends it as an API request to the generative AI model. The server asks the model to generate a code snippet based on the prompt.
[1827] Step 4:
[1828] The generative AI model generates code snippets based on the prompt. Specifically, the generative AI model uses natural language processing techniques to analyze the prompt and generate the corresponding code snippet. This generation process takes the prompt as data input and provides Python code as text output.
[1829] Step 5:
[1830] The server receives the code snippet returned by the generative AI model and sends it to the device. The code snippet generated on the server is reformatted as text data and sent to the device as an HTTP response.
[1831] Step 6:
[1832] The terminal displays the code snippet received from the server to the user. The terminal parses the data received as an HTTP response and displays the generated code to the user through an appropriate GUI, allowing the user to review the generated code and proceed to the next step if necessary.
[1833] Step 7:
[1834] When a user wants to optimize existing code, they input the original code into the terminal. The user inputs a request such as "Please optimize the following code" and includes the code to be optimized. This input data is used for the next optimization process.
[1835] Step 8:
[1836] The device sends an optimization request to the server. The original code received from the user is sent to the server in JSON format as an optimization request.
[1837] Step 9:
[1838] The server requests the generative AI model to optimize the code. The server sends the received code to the generative AI model and requests the generative AI model to perform optimizations to improve performance.
[1839] Step 10:
[1840] A generative AI model analyzes the code and generates optimized code. The generative AI model uses multiple optimization techniques to improve the performance of the code. The input data is the original code, and the output data is optimized code.
[1841] Step 11:
[1842] The server sends the optimized code to the device, where it is reformatted as text data and sent as an HTTP response to the device.
[1843] Step 12:
[1844] The terminal displays the optimized code received from the server to the user. The terminal analyzes the data received as an HTTP response and displays the optimized code to the user through an appropriate GUI, allowing the user to review the optimized code and proceed to the next step.
[1845] Furthermore, an emotion engine that estimates the user's emotion may be further combined. That is, the identification processing unit 290 may estimate the user's emotion using the emotion identification model 59, and perform identification processing using the user's emotion.
[1846] The present invention provides a system for generating code snippets based on user-entered prompts, and optimizing and debugging the received code. Furthermore, the system's effectiveness is enhanced by incorporating an emotion engine that recognizes the user's emotions and adjusts the generated code and prompts accordingly. The system is specifically implemented as follows:
[1847] System Configuration
[1848] 1. Terminal
[1849] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[1850] 2. Server
[1851] The server is a multi-functional computer system that works with generative AI models to generate, optimize, and debug code based on prompts, and also includes an emotion engine that recognizes user emotions and reflects them in the code generation process.
[1852] 3. Emotion Engine
[1853] The emotion engine analyzes emotions based on user input and other user data, and adjusts the code and optimization prompts output by the generative AI model, reducing user stress and providing a better development experience.
[1854] 4. Users
[1855] Users are developers who operate the system and want to generate, optimize, and debug code.
[1856] Program Description
[1857] Generate code snippets
[1858] When a user wants to generate a code snippet in a specific programming language, they enter a prompt into the terminal, for example, "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server uses an emotion engine to analyze the user's emotion and sends a request to the generative AI model. This request includes the prompt content and adjustments based on the user's emotion. The generative AI model generates a code snippet based on the prompt and sends the result back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[1859] Code optimization
[1860] When a user wants to optimize existing code, they input the original code into the device. For example, they input the code for a binary search algorithm. The device then sends this optimization request to the server. The server uses an emotion engine to analyze the user's emotions and adjusts the optimization prompt based on those emotions. The server then sends the code along with the prompt to a generative AI model, which generates optimized code. The result is then sent back to the server, which then sends the optimized code back to the device, which then displays it to the user.
[1861] Debugging bugs
[1862] If a user wants to debug buggy code, they enter the buggy code into their device—for example, a buggy version of the binary search algorithm mentioned above. The device then sends this debug request to the server. The server uses an emotion engine to analyze the user's emotion and tailors the debug prompt based on that emotion. It then sends the code along with the prompt to a generative AI model, which generates debugged code. The result is then sent back to the server, which then sends the debugged code back to the device, which displays it to the user.
[1863] Specific examples
[1864] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[1865] 1. The user types a prompt into the terminal.
[1866] 2. The terminal sends a prompt to the server.
[1867] 3. The server analyzes the user's emotions using an emotion engine and sends a request to a generative AI model to generate a code snippet.
[1868] 4. The server sends the generated code back to the device.
[1869] 5. The terminal displays the code snippet to the user.
[1870] Optimization and debugging are also performed in a similar manner based on user emotions. For example, if a user enters code saying, "Please optimize the following code," the server analyzes the emotion through the emotion engine and sends an optimization prompt to the generative AI model. The generative AI model then generates optimized code, sends it back to the device via the server, and is ultimately displayed to the user. Bug fixes are also adjusted by the emotion engine, improving user satisfaction.
[1871] This allows users to generate, optimize, and debug code efficiently and with empathy in mind.
[1872] The processing flow will be explained below.
[1873] Generate code snippets
[1874] Step 1:
[1875] A user types a prompt into a terminal indicating that they would like to generate a code snippet in a specific programming language, for example, "Implement a binary search algorithm in Python."
[1876] Step 2:
[1877] The terminal sends this prompt to the server.
[1878] Step 3:
[1879] The server receives the prompt and passes the prompt and user information to the emotion engine to analyze the emotion.
[1880] Step 4:
[1881] The emotion engine analyzes the user's emotions and sends the results back to the server. For example, if the user is feeling stressed, it will return that information.
[1882] Step 5:
[1883] The server adjusts the prompts based on the analysis results of the emotion engine and sends them to the generative AI model.
[1884] Step 6:
[1885] The generative AI model generates code snippets based on the prompts and sends the results back to the server.
[1886] Step 7:
[1887] The server sends the generated code snippet back to the device.
[1888] Step 8:
[1889] The terminal displays the generated code received from the server to the user.
[1890] Code optimization
[1891] Step 1:
[1892] The user enters the original code into the terminal along with a request to optimize the existing code, for example, the code for a binary search algorithm.
[1893] Step 2:
[1894] The device sends this optimization request to the server.
[1895] Step 3:
[1896] The server receives the request and passes the original code and user information to the emotion engine to analyze the emotion.
[1897] Step 4:
[1898] The emotion engine analyzes the user's emotions and sends the results back to the server. For example, if the user is feeling anxious, it will return that information.
[1899] Step 5:
[1900] The server adjusts the optimization prompt based on the analysis results of the emotion engine and sends it to the generative AI model.
[1901] Step 6:
[1902] The generative AI model generates optimized code to improve performance based on the optimization prompts and sends the results back to the server.
[1903] Step 7:
[1904] The server returns the generated optimized code to the terminal.
[1905] Step 8:
[1906] The terminal displays the optimization code received from the server to the user.
[1907] Debugging bugs
[1908] Step 1:
[1909] A user enters buggy code into a terminal along with a request to debug the code, for example, a buggy version of a binary search algorithm.
[1910] Step 2:
[1911] The device sends this debug request to the server.
[1912] Step 3:
[1913] The server receives the request and passes the buggy code and user information to the emotion engine to analyze the emotion.
[1914] Step 4:
[1915] The emotion engine analyzes the user's emotions and sends the results back to the server. For example, if the user is irritated, it will return that information.
[1916] Step 5:
[1917] The server adjusts the debug prompt based on the analysis results of the emotion engine and sends it to the generative AI model.
[1918] Step 6:
[1919] The generative AI model generates code that fixes the bug based on the debug prompts and sends the results back to the server.
[1920] Step 7:
[1921] The server sends the generated debug code back to the device.
[1922] Step 8:
[1923] The terminal displays the debug code received from the server to the user.
[1924] These steps allow users to generate, optimize, and debug code efficiently and with emotion in mind.
[1925] Example 2
[1926] Next, a description will be given of Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[1927] In conventional code generation systems, users input prompts and the generated code is not always optimized for the user's emotions or situation, which often leads to stress and dissatisfaction. Furthermore, code optimization and debugging must be done manually, making the development process inefficient. As a result, developer productivity is reduced.
[1928] The specific processing by the specific processing unit 290 of the data processing device 12 in the second embodiment is realized by the following means.
[1929] In this invention, the server includes: [means for receiving input from a user; [means for sending the entered prompt to a generative AI model and generating a code snippet; [means for returning the generated code snippet to the user;] [means for sending a prompt for optimizing the received code to a generative AI model and generating optimized code; [means for returning the generated optimized code to the user;] [means for sending buggy code received from the user to a generative AI model and generating debugged code; [means for returning the generated debug code to the user; and] means for analyzing the user's emotions using an emotion engine and adjusting the prompts and generated code based thereon. This makes it possible [to generate, optimize, and debug code according to the user's emotions and needs].
[1930] "User" refers to the developer or programmer who operates the system and requests code generation, optimization, and debugging.
[1931] A "terminal" is a device operated by a user, such as a computer or mobile device, that accepts input, sends requests, and displays results.
[1932] "Server" refers to a high-performance computer system for running the generative AI model and emotion engine, as well as receiving prompts, emotion analysis, code generation, optimization, and debugging.
[1933] A "prompt" is an instruction or request that a user enters into the system, such as a request for code generation, optimization, or debugging.
[1934] "Code snippet" refers to a portion of a program generated by a generative AI model.
[1935] "Generative AI model" refers to an artificial intelligence model used to generate, optimize, and debug code based on user prompts.
[1936] An "emotion engine" refers to a technology that analyzes emotions based on user input and past interactions and reflects the results in a generative AI model.
[1937] "Optimization" refers to the process of making existing code more efficient and performant.
[1938] "Debugging" refers to the process of fixing buggy code so that it works properly.
[1939] The present invention is a system that generates code snippets based on user-entered prompts, and then optimizes and debugs the received code. Furthermore, the system incorporates an emotion engine that recognizes the user's emotions and adjusts the generated code and prompts accordingly, enhancing its effectiveness. The system of the present invention consists of several key components:
[1940] System Components
[1941] 1. Users
[1942] The user is a developer who operates the system and wants to generate code, optimize, and debug it. The user enters prompts and code into a terminal and receives the results.
[1943] 2. Terminal
[1944] A terminal is a device operated by a user that accepts input, displays, and sends requests. Users enter prompts and codes through the terminal. The terminal can be a PC, smartphone, tablet, etc.
[1945] 3. Server
[1946] The server is a multi-functional computer system that works with the generative AI model to generate, optimize, and debug code based on prompts. It also has an emotion engine that recognizes user emotions and reflects them in the code generation process. Specifically, it uses a natural language generation engine (e.g., GPT-3) as the generative AI model and EmotionAPI or similar for the emotion engine.
[1947] 4. Generative AI Models
[1948] Generative AI models are natural language generation engines used to generate, optimize, and debug code based on user prompts, with GPT-3 being an example use case.
[1949] 5. Emotion Engine
[1950] The emotion engine is a technology that analyzes emotions based on user input and past interactions and reflects the results in generative AI models. It uses EmotionAPI to analyze user emotions.
[1951] Explanation of program processing
[1952] Generate code snippets
[1953] When a user wants to generate a code snippet in a specific programming language, they enter a prompt into their device: "Implement a binary search algorithm in Python." The device then sends this prompt to the server. The server uses an emotion engine to analyze the user's emotion and sends the analysis result and the prompt to the generative AI model. The generative AI model uses this information to generate a code snippet and sends it back to the server. The server then sends the generated code snippet back to the device, which then displays it to the user.
[1954] Code optimization
[1955] When a user wants to optimize existing code, they input the original code into their device. For example, they input the code for a binary search algorithm. The device then sends this optimization request to the server. The server uses an emotion engine to analyze the user's emotions and sends the analysis results and the original code as an optimization prompt to the generative AI model. The generative AI model generates optimized code and sends it back to the server. The server then sends the optimized code back to the device, which displays it to the user.
[1956] Debugging bugs
[1957] When a user wants to debug buggy code, they input the buggy code into their device. For example, they input the code for a buggy binary search algorithm. The device then sends this debug request to the server. The server uses an emotion engine to analyze the user's emotions and sends the analysis result and the buggy code as a debug prompt to the generative AI model. The generative AI model generates debugged code and sends it back to the server. The server then sends the debugged code back to the device, which then displays it to the user.
[1958] Specific examples
[1959] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[1960] 1. The user types a prompt into the terminal.
[1961] 2. The terminal sends a prompt to the server.
[1962] 3. The server analyzes the user's emotions using an emotion engine and sends a request to a generative AI model to generate a code snippet.
[1963] 4. The server sends the generated code snippet back to the device.
[1964] 5. The terminal displays the code snippet to the user.
[1965] Optimization and debugging are also performed in a similar manner based on user emotions. For example, if a user enters code saying, "Please optimize the following code," the server analyzes the emotion through the emotion engine and sends an optimization prompt to the generative AI model. The generative AI model then generates optimized code, sends it back to the device via the server, and is ultimately displayed to the user. Bug fixes are also adjusted by the emotion engine, improving user satisfaction.
[1966] As described above, the present invention allows users to generate, optimize, and debug code efficiently while taking emotions into account.
[1967] The flow of the identification process in the second embodiment will be described with reference to FIG.
[1968] Generate code snippets
[1969] Step 1:
[1970] If a user wants to generate a code snippet in a specific programming language, they can type the prompt "Implement a binary search algorithm in Python" into the terminal.
[1971] Input: Prompt statement "Implement a binary search algorithm in Python"
[1972] Output: The prompt the user types into the terminal
[1973] Step 2:
[1974] The terminal sends the entered prompt to the server.
[1975] Input: The prompt received from the user
[1976] Data processing: Convert the prompt text into a format that can be sent to the server as an HTTP request
[1977] Output: Prompt text sent to the server
[1978] Step 3:
[1979] The server uses an emotion engine to analyze the user's emotions.
[1980] Input: The prompt sent to the server and the user's previous input data
[1981] Data calculation: Sentiment analysis using sentiment analysis tools such as EmotionAPI
[1982] Output: Sentiment analysis results (e.g., stress level, satisfaction, etc.)
[1983] Step 4:
[1984] The server sends the emotion analysis results and prompt sentence as a request to the generative AI model.
[1985] Input: prompt and sentiment analysis results
[1986] Data processing: shaping data into a format that can be fed into a generative AI model
[1987] Output: The request sent to the generative AI model
[1988] Step 5:
[1989] The generative AI model generates a code snippet based on the prompt text and sentiment analysis results and sends it back to the server.
[1990] Input: The request sent by the server
[1991] Data Calculation: Code generation based on prompt sentences and sentiment analysis results
[1992] Output: Generated code snippet
[1993] Step 6:
[1994] The server sends the generated code snippet back to the device.
[1995] Input: Code snippet received from the generative AI model
[1996] Data processing: Converting data into a format that can be sent back to the device as an HTTP response
[1997] Output: Code snippet sent to the terminal
[1998] Step 7:
[1999] The terminal displays the code snippet to the user.
[2000] Input: Code snippet received from the server
[2001] Data processing: Display in a visually understandable format for users
[2002] Output: The code snippet displayed to the user
[2003] Code optimization
[2004] Step 1:
[2005] The user enters into the terminal the existing code they wish to optimize, for example the code for a binary search algorithm.
[2006] Input: Original code
[2007] Output: The original code that the user entered into the terminal
[2008] Step 2:
[2009] The device sends an optimization request to the server.
[2010] Input: The code received from the user
[2011] Data processing: Converting data into a format to be sent to the server as an HTTP request
[2012] Output: The code sent to the server
[2013] Step 3:
[2014] The server uses an emotion engine to analyze the user's emotions.
[2015] Input: The code sent to the server and any previous inputs from the user
[2016] Data calculation: Sentiment analysis using sentiment analysis tools such as EmotionAPI
[2017] Output: Emotion analysis results
[2018] Step 4:
[2019] The server sends the sentiment analysis results and the original code as a request to the generated AI model.
[2020] Input: Original code and sentiment analysis results
[2021] Data processing: shaping data into a format that can be fed into a generative AI model
[2022] Output: The request sent to the generative AI model
[2023] Step 5:
[2024] The generative AI model generates optimized code based on the original code and sends it back to the server.
[2025] Input: The request sent by the server
[2026] Data calculation: Optimization process based on the original code and sentiment analysis results
[2027] Output: Optimized code
[2028] Step 6:
[2029] The server sends the optimized code back to the device.
[2030] Input: Optimized code received from a generative AI model
[2031] Data processing: Converting data into a format that can be sent back to the device as an HTTP response
[2032] Output: Optimized code sent to the terminal
[2033] Step 7:
[2034] The terminal displays the optimized code to the user.
[2035] Input: Optimized code received from the server
[2036] Data processing: Display in a visually understandable format for users
[2037] Output: The optimized code displayed to the user
[2038] Debugging bugs
[2039] Step 1:
[2040] The user types into the terminal the buggy code they want to debug, for example the code for a buggy binary search algorithm.
[2041] Input: Buggy code
[2042] Output: The buggy code as entered by the user into the terminal
[2043] Step 2:
[2044] The device sends a debug request to the server.
[2045] Input: Buggy code received from the user
[2046] Data processing: Converting data into a format to be sent to the server as an HTTP request
[2047] Output: The buggy code sent to the server
[2048] Step 3:
[2049] The server uses an emotion engine to analyze the user's emotions.
[2050] Input: The buggy code sent to the server and the user's previous input data
[2051] Data calculation: Sentiment analysis using sentiment analysis tools such as EmotionAPI
[2052] Output: Emotion analysis results
[2053] Step 4:
[2054] The server sends the sentiment analysis results and the buggy code as a request to the generated AI model.
[2055] Input: Buggy code and sentiment analysis results
[2056] Data processing: shaping data into a format that can be fed into a generative AI model
[2057] Output: The request sent to the generative AI model
[2058] Step 5:
[2059] The generative AI model generates debugged code based on the buggy code and sends it back to the server.
[2060] Input: The request sent by the server
[2061] Data calculation: Debugging process based on buggy code and sentiment analysis results
[2062] Output: Debugged code
[2063] Step 6:
[2064] The server sends the debugged code back to the device.
[2065] Input: Debugged code received from the generative AI model
[2066] Data processing: Converting data into a format that can be sent back to the device as an HTTP response
[2067] Output: Debugged code sent to the terminal
[2068] Step 7:
[2069] The terminal displays the debugged code to the user.
[2070] Input: The debugged code received from the server
[2071] Data processing: Display in a visually understandable format for users
[2072] Output: The debugged code displayed to the user
[2073] (Application example 2)
[2074] Next, a description will be given of Application Example 2. In the following description, the data processing device 12 will be referred to as a "server" and the robot 414 will be referred to as a "terminal."
[2075] Managing robot operations efficiently and safely is a key challenge for factory robot control systems. However, currently, generating, optimizing, and debugging robot program code requires a significant amount of time and expertise. In particular, when a problem occurs in the robot's control code, it is difficult to quickly debug it, significantly impacting productivity. Furthermore, the emotional state of the operator can lead to stress and reduced work efficiency. To address these issues, a system is needed that takes into account the operator's emotions while automating robot program code management.
[2076] The specific processing by the specific processing unit 290 of the data processing device 12 in Application Example 2 is realized by the following means. In this invention, the server includes means for receiving input from a user, means for sending the input prompt to the generative AI model and generating a code snippet, means for returning the generated code snippet to the user, means for sending a prompt for optimizing the received code to the generative AI model and generating optimized code, means for returning the generated optimized code to the user, means for sending buggy code received from the user to the generative AI model and generating debugged code, means for returning the generated debug code to the user, means for analyzing user emotions using an emotion engine and adjusting the prompts and generated code, and means for being incorporated into a robot control system in a factory and performing code generation, optimization, and debugging to improve robot work efficiency. This automates the generation, optimization, and debugging of robot control code, enabling efficient work that takes operator emotions into consideration.
[2077] "Means for receiving input from a user" refers to a function that receives prompts or codes entered by a user through a terminal.
[2078] "Means for sending an input prompt to a generative AI model and generating a code snippet" refers to a function that sends a prompt entered by a user to a generative AI model and generates specific code based on the prompt.
[2079] The "means for returning the generated code snippet to the user" is a function for returning and displaying the code snippet generated by the generative AI model to the user.
[2080] "Means for sending prompts to optimize the received code to a generative AI model and generating optimized code" refers to a function for sending prompts to optimize existing code entered by a user to a generative AI model, thereby generating optimized code.
[2081] The "means for returning the generated optimized code to the user" is a function for returning the optimized code to the user and displaying it.
[2082] The "means for sending buggy code received from a user to a generative AI model and generating debugged code" refers to a function for sending buggy code entered by a user to a generative AI model and generating debugged code based on the prompts.
[2083] The "means for returning generated debug code to the user" is a function for returning the debugged code to the user and displaying it.
[2084] "Means for analyzing the user's emotions using an emotion engine and adjusting the prompts and generated codes" is a function that uses an emotion engine that analyzes the user's emotions to provide the optimal prompts and codes according to the user's emotional state.
[2085] "A means for being incorporated into the robot control system within a factory and for generating, optimizing, and debugging code to improve the work efficiency of the robot" refers to a function incorporated into the system that controls the robot within a factory, which generates, optimizes, and debugs the code required to improve the work efficiency of the robot.
[2086] This invention relates to a system that utilizes a generative AI model and an emotion engine to realize code generation, optimization, and debugging for a robot control system in a factory. This system is configured as follows to efficiently manage robot programs while taking into account the user's emotions.
[2087] System Configuration
[2088] 1. Terminal
[2089] A terminal is a device operated by a user that accepts, displays, and transmits input. A user enters prompts or codes through a terminal.
[2090] 2. Server
[2091] The server is a multi-functional computer system that works with generative AI models to generate, optimize, and debug code based on prompts, and also includes an emotion engine that recognizes user emotions and reflects them in the code generation process.
[2092] 3. Emotion Engine
[2093] The emotion engine analyzes emotions based on user input and other user data and adjusts the code and prompts output by the generative AI model, reducing user stress and providing a better development experience.
[2094] 4. Users
[2095] A user is a person who operates the system and wants to generate, optimize, and debug code.
[2096] Program Description
[2097] Generate code snippets
[2098] When a user wants to generate robot control code for a specific task, they enter a prompt into the terminal, for example, "Implement a binary search algorithm in Python." The terminal then sends this prompt to the server. The server uses an emotion engine to analyze the user's emotion and sends a request to the generative AI model. This request includes the prompt content and adjustments based on the user's emotion. The generative AI model generates a code snippet based on the prompt and sends the result back to the server. The server then sends the generated code back to the terminal, which displays it to the user.
[2099] Code optimization
[2100] When a user wants to optimize existing robot control code, they input the original code into the device. For example, they input the code for a binary search algorithm. The device then sends this optimization request to the server. The server uses an emotion engine to analyze the user's emotions and adjusts the optimization prompt based on those emotions. It then sends the code along with the prompt to a generative AI model, which generates optimized code. The result is then sent back to the server, which then sends the optimized code back to the device, which displays it to the user.
[2101] Debugging bugs
[2102] If a user wants to debug buggy code, they enter the buggy code into their device—for example, a buggy version of the binary search algorithm mentioned above. The device then sends this debug request to the server. The server uses an emotion engine to analyze the user's emotion and tailors the debug prompt based on that emotion. It then sends the code along with the prompt to a generative AI model, which generates debugged code. The result is then sent back to the server, which then sends the debugged code back to the device, which displays it to the user.
[2103] Specific examples
[2104] For example, if a user enters the prompt "Implement a binary search algorithm in Python," the following sequence of events will occur:
[2105] 1. The user types a prompt into the terminal.
[2106] 2. The terminal sends a prompt to the server.
[2107] 3. The server analyzes the user's emotions using an emotion engine and sends a request to a generative AI model to generate a code snippet.
[2108] 4. The server sends the generated code back to the device.
[2109] 5. The terminal displays the code snippet to the user.
[2110] The hardware used in this process includes terminals and servers, and the software uses generative AI models and emotion engines. A specific example of use is "Please optimize the following Python code."
[2111] Please optimize the following Python code:
[2112] code:
[2113] def binary_search(arr, target):
[2114] left, right = 0, len(arr) - 1
[2115] while left <= right:
[2116] mid = (left + right) / / 2
[2117] if arr[mid] == target:
[2118] return mid
[2119] elif arr[mid] < target:
[2120] left = mid + 1
[2121] else:
[2122] right = mid - 1
[2123] return -1
[2124] This allows users to generate, optimize, and debug code efficiently and with consideration for emotions.
[2125] The flow of the specific processing in the application example 2 will be described with reference to FIG.
[2126] Step 1:
[2127] The user uses the terminal to input prompts or code, which can include prompt statements such as "Implement a binary search algorithm in Python" or existing code. The input data is received by the terminal.
[2128] Step 2:
[2129] The device then sends the received prompt or code to the server, which then appropriately formats the input and sends it as data.
[2130] Step 3:
[2131] The server uses an emotion engine to analyze the user's emotions, based on the user's input data, past usage history, etc. The emotion engine analyzes the user's emotional state and adjusts the prompts and generated code based on that data.
[2132] Step 4:
[2133] Based on the user's emotional data analyzed by the emotion engine, the server requests the generative AI model to send prompts and generate code, including adjusting the prompts according to the user's emotions.
[2134] Step 5:
[2135] The generative AI model generates code snippets based on the prompt it receives, for example, "Implement a binary search algorithm in Python," and generates the appropriate Python code. The generated code snippets are then sent back to the server.
[2136] Step 6:
[2137] The server returns the generated code to the device. If any adjustments have been made by the emotion engine, the code that reflects the adjustments is returned.
[2138] Step 7:
[2139] The terminal displays the generated code received from the server to the user, allowing the user to confirm the generated code.
[2140] Step 8:
[2141] If a user wants to optimize an existing code, they input the existing code along with an optimization request into the terminal, for example, "Please optimize the following code" and the original code. The terminal then sends this request and the code to the server.
[2142] Step 9:
[2143] When the server sends an optimization request to the generative AI model, it analyzes the user's emotions using an emotion engine and adjusts the optimization prompt based on the results.
[2144] Step 10:
[2145] The generative AI model optimizes the code based on the tailored prompts and sends the optimized code back to the server.
[2146] Step 11:
[2147] The server returns the optimized code to the terminal, which displays it to the user, who can then view the optimized code.
[2148] Step 12:
[2149] When a user wants to debug buggy code, they enter the buggy code into the terminal along with a debug request, which the terminal sends to the server.
[2150] Step 13:
[2151] When the server sends a debug request to the generative AI model, it analyzes the user's emotions with an emotion engine and adjusts the debug prompt based on the results.
[2152] Step 14:
[2153] The generative AI model performs the debugging tasks based on the tailored prompts and sends the debugged code back to the server.
[2154] Step 15:
[2155] The server sends the debugged code back to the terminal, which displays it to the user, who can then view the debugged code.
[2156] Through these processing steps, the system of the present invention enables the generation, optimization, and debugging of robot control code in an efficient and emotionally sensitive manner.
[2157] The specific processing unit 290 transmits the result of the specific processing to the robot 414. In the robot 414, the control unit 46A causes the speaker 240 and the control target 443 to output the result of the specific processing. The microphone 238 acquires voice indicating a user input regarding the result of the specific processing. The control unit 46A transmits voice data indicating the user input acquired by the microphone 238 to the data processing device 12. In the data processing device 12, the specific processing unit 290 acquires the voice data.
[2158] The data generation model 58 is a so-called generative AI (Artificial Intelligence). An example of the data generation model 58 is ChatGPT (Internet Search<URL: https: / / openai.com / blog / chatgpt> ), Gemini (Internet search <url: https: gemini.google.com ?hl="ja">) and other generation AIs. The data generation model 58 is obtained by performing deep learning on a neural network. A prompt including an instruction is input to the data generation model 58, and inference data such as voice data indicating voice, text data indicating text, and image data indicating an image is also input. The data generation model 58 performs inference on the input inference data in accordance with the instruction indicated by the prompt, and outputs the inference result in a data format such as voice data and text data. Here, inference refers to, for example, analysis, classification, prediction, and / or summarization.
[2159] In the above embodiment, an example was given in which the specific processing is performed by the data processing device 12, but the technology of the present disclosure is not limited to this, and the specific processing may be performed by the robot 414.
[2160] The emotion identification model 59 as an emotion engine may determine the user's emotion according to a specific mapping. Specifically, the emotion identification model 59 may determine the user's emotion according to an emotion map (see FIG. 9), which is a specific mapping. Similarly, the emotion identification model 59 may determine the robot's emotion, and the identification processing unit 290 may perform identification processing using the robot's emotion.
[2161] FIG. 9 is a diagram illustrating an emotion map 400 on which multiple emotions are mapped. In the emotion map 400, emotions are arranged in concentric circles radiating from the center. Emotions closer to the center of the concentric circles are more primitive. Emotions representing states and actions arising from a state of mind are arranged on the outer edges of the concentric circles. The concept of emotion includes both affect and mental states. Emotions generally generated from reactions occurring in the brain are arranged on the left side of the concentric circles. Emotions generally induced by situational judgment are arranged on the right side of the concentric circles. Emotions generally generated from reactions occurring in the brain and induced by situational judgment are arranged on the upper and lower sides of the concentric circles. Furthermore, the emotion of "pleasure" is arranged on the upper side of the concentric circles, and the emotion of "discomfort" is arranged on the lower side. In this way, in the emotion map 400, multiple emotions are mapped based on the structure by which emotions are generated, and emotions that tend to occur simultaneously are mapped close to each other.
[2162] These emotions are distributed in the 3 o'clock direction on emotion map 400, and typically fluctuate between relief and anxiety. In the right half of emotion map 400, situational awareness dominates over internal sensations, resulting in a sense of calm.
[2163] The inside of emotion map 400 represents what is going on in the mind, and the outside of emotion map 400 represents behavior, so the further you go outside emotion map 400, the more visible the emotions become (the more they are expressed in behavior).
[2164] Human emotions are based on various balances, such as posture and blood sugar levels. When these balances deviate from the ideal, a state of discomfort is indicated, and when they approach the ideal, a state of pleasure is indicated. Emotions can also be created for robots, automobiles, and motorcycles, based on various balances, such as posture and remaining battery life. When these balances deviate from the ideal, a state of discomfort is indicated, and when they approach the ideal, a state of pleasure is indicated. An emotion map can be generated, for example, based on Dr. Mitsuyoshi's emotion map (Research on Voice Emotion Recognition and Emotional Brain Physiological Signal Analysis Systems, Tokushima University, Doctoral Dissertation: https: / / ci.nii.ac.jp / naid / 500000375379). The left half of the emotion map lists emotions belonging to the "reaction" domain, where sensation is dominant. The right half of the emotion map lists emotions belonging to the "situation" domain, where situational awareness is dominant.
[2165] The emotion map defines two emotions that promote learning. One is a negative emotion on the situation side, around the middle of "repentance" or "reflection." In other words, this occurs when the robot experiences negative emotions such as "I never want to feel this way again" or "I don't want to be scolded again." The other is a positive emotion on the response side, around "desire." In other words, this occurs when the robot experiences positive feelings such as "I want more" or "I want to know more."
[2166] The emotion identification model 59 inputs user input into a pre-trained neural network, obtains emotion values indicating each emotion shown in the emotion map 400, and determines the user's emotion. This neural network is pre-trained based on multiple pieces of training data that are combinations of user input and emotion values indicating each emotion shown in the emotion map 400. Furthermore, this neural network is trained so that emotions that are located close to each other have similar values, as in the emotion map 900 shown in FIG. 10. FIG. 10 shows an example in which multiple emotions, "relieved," "calm," and "reassuring," have similar emotion values.
[2167] The system according to the present disclosure has been described above mainly with respect to the functions of the data processing device 12, but the system according to the present disclosure is not necessarily implemented on a server. The system according to the present disclosure may be implemented as a general information processing system. The present disclosure may be implemented, for example, as a software program running on a personal computer or an application running on a smartphone, etc. The method according to the present disclosure may be provided to users in the form of SaaS (Software as a Service).
[2168] In the above embodiment, an example was given in which the specific processing is performed by one computer 22, but the technology of the present disclosure is not limited to this, and the specific processing may be distributed and performed by a plurality of computers including the computer 22. For example, the data generation model 58 may be provided in an external device of the data processing device 12, and data may be generated in the external device in accordance with input data.
[2169] In the above embodiment, an example in which the specific processing program 56 is stored in the storage 32 has been described, but the technology of the present disclosure is not limited to this. For example, the specific processing program 56 may be stored in a portable, computer-readable, non-transitory storage medium such as a USB (Universal Serial Bus) memory. The specific processing program 56 stored in the non-transitory storage medium is installed in the computer 22 of the data processing device 12. The processor 28 executes the specific processing in accordance with the specific processing program 56.
[2170] Alternatively, the specific processing program 56 may be stored in a storage device such as a server connected to the data processing device 12 via the network 54, and the specific processing program 56 may be downloaded and installed on the computer 22 in response to a request from the data processing device 12.
[2171] It is not necessary to store all of the specific processing program 56 in a storage device such as a server connected to the data processing device 12 via the network 54, or to store all of the specific processing program 56 in the storage 32; only a portion of the specific processing program 56 may be stored.
[2172] The hardware resource for executing a specific process can be any of the following processors: An example of a processor is a CPU, which is a general-purpose processor that functions as a hardware resource for executing a specific process by executing software, i.e., a program. Another example of a processor is a dedicated electrical circuit, such as an FPGA (Field-Programmable Gate Array), a PLD (Programmable Logic Device), or an ASIC (Application Specific Integrated Circuit), which is a processor with a circuit configuration designed specifically for executing a specific process. Each processor has built-in or connected memory, and each processor uses the memory to execute the specific process.
[2173] The hardware resource that executes the specific processing may be configured with one of these various processors, or may be configured with a combination of two or more processors of the same or different types (for example, a combination of multiple FPGAs, or a combination of a CPU and an FPGA). Also, the hardware resource that executes the specific processing may be a single processor.
[2174] As an example of a system configured with a single processor, first, one processor is configured by combining one or more CPUs and software, and this processor functions as a hardware resource that executes a specific process. Second, there is a system that uses a processor that realizes the functions of an entire system including multiple hardware resources that execute a specific process on a single IC chip, as typified by SoC (System-on-a-chip). In this way, a specific process is realized using one or more of the above-mentioned various processors as hardware resources.
[2175] Furthermore, the hardware structure of these various processors can be, more specifically, an electric circuit that combines circuit elements such as semiconductor devices. The specific processing described above is merely an example. Therefore, it goes without saying that unnecessary steps may be deleted, new steps may be added, or the processing order may be rearranged, without departing from the spirit of the invention.
[2176] The above-described description and illustrations are a detailed explanation of the parts related to the technology of the present disclosure and are merely an example of the technology of the present disclosure. For example, the above description of the configuration, functions, actions, and effects is an explanation of an example of the configuration, functions, actions, and effects of the parts related to the technology of the present disclosure. Therefore, it goes without saying that unnecessary parts may be deleted, new elements may be added, or replacements may be made to the above-described description and illustrations within the scope of the gist of the technology of the present disclosure. Furthermore, to avoid confusion and facilitate understanding of the parts related to the technology of the present disclosure, the above-described description and illustrations omit explanations of common technical knowledge that do not require particular explanation to enable the implementation of the technology of the present disclosure.
[2177] All publications, patent applications, and technical standards mentioned in this specification are herein incorporated by reference to the same extent as if each individual publication, patent application, or technical standard was specifically and individually indicated to be incorporated by reference.
[2178] The following is further disclosed regarding the above embodiment.
[2179] (Claim 1)
[2180] means for receiving input from a user;
[2181] A means for sending the input prompt to a generative AI model to generate a code snippet;
[2182] means for returning the generated code snippet to the user;
[2183] a means for sending prompts to the generation AI model to optimize the received code and generate optimized code;
[2184] means for re...
Claims
1. means for receiving input from a user; A means for sending the input prompt to a generative AI model to generate a code snippet; means for returning the generated code snippet to the user; a means for sending prompts to the generation AI model to optimize the received code and generate optimized code; means for returning the generated optimized code to the user; a means for sending the buggy code received from the user to the generation AI model to generate debugged code; The system includes a means for returning the generated debug code to the user.
2. 2. The system of claim 1, wherein the code snippet generator generates code snippets based on a specific programming language.
3. 2. The system of claim 1, wherein the optimization means uses a plurality of code optimization techniques to optimize performance.
Citation Information
Patent Citations
Persona chatbot control method and system
JP2022180282A