I create educational videos about programming targeting a near beginner audience. A…
- User
I create educational videos about programming targeting a near beginner audience. A major task for me is writing the scripts for voice overs describing a block of code. I need my scripts to be short while describing what the code is doing line by line, usually a simple sentence for each line if it's straight-forward. Here is a sample function that I want you to create the script for:
pub fn spawn_task(commands: &mut Commands, prompt: String) { let thread_pool = AsyncComputeTaskPool::get(); let task = thread_pool.spawn(async move { call_open_ai_api(prompt) }); // Spawn new entity and add our new task as a component commands.spawn(OpenAiTask(task)); }``` - Assistant
Sure! Here is a short script for description of the code line by line: Here we have function definition that is used to create a task for an Open AI API call. On the first line we define its parameters
commandsandprompt, which are used to define the instance ofCommandswe want to add the task component to and a string prompt for the API call respectively. The following line gets a global task pool for asynchronous computing that can be used to start a task on the thread without blocking it, while it waits for any network request. On the next line we use a function on that pool to create a task, it takes aFuture- an asynchronous call that is used to create and returnTaskin which we call the Open AI API. The last line callsspawnfunction on thecommandswith the return value ofOpenAiTaskfunction with thetaskas its argument that spawns a new entity and adds the task as a component.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →
- Human-written demonstration (OpenAssistant volunteers)Compare side by side →