Jump to content

Prompt engineering: Difference between revisions

Line 15: Line 15:


===Context===
===Context===
If you want to use a library that the coding model is not familiar with, you can guide it by describing the API library beforehand.
For instance, the Minecraft Codex sample uses the Simulated Player API in TypeScript to control a character in the game. Since this is a newer API that Codex does not know about yet, let's see how it generates code for it. When given the prompt, Codex attempts to make an educated guess based on the terms "bot" and "Simulated Player". However, the resulting code is not correct.
To correct this, you can show Codex the API definition, including function signatures and examples, so that it can generate code that follows the API correctly. As demonstrated in the example, by providing high-level context in the form of the API definition and examples, Codex can understand what you want it to do and generate more accurate code.


==How to Create Descriptive, Poetic Text==
==How to Create Descriptive, Poetic Text==
370

edits