Created
August 16, 2021 15:52
-
-
Save sabetAI/8763aa60a31145fdab837b67715e2821 to your computer and use it in GitHub Desktop.
Example Prompt for Codex /answers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openai | |
openai.api_key = os.getenv("OPENAI_API_KEY") | |
openai.Answer.create( | |
search_model="cushman-codex", | |
model="davinci-codex", | |
question="Where is the React component FloatingMenu defined?", | |
examples_context='''public shouldShow: Exclude<FloatingMenuPluginProps['shouldShow'], null> = ({ state }) => { | |
const { selection } = state | |
const { $anchor, empty } = selection | |
const isRootDepth = $anchor.depth === 1 | |
const isEmptyTextBlock = $anchor.parent.isTextblock | |
&& !$anchor.parent.type.spec.code | |
&& !$anchor.parent.textContent | |
if (!empty || !isRootDepth || !isEmptyTextBlock) { | |
return false | |
} | |
return true | |
}''', | |
examples=[["What does the shouldShow method do?", "checks if state is empty, depth is root, and text block is empty"]], | |
file=filename, | |
max_rerank=10, | |
max_tokens=500, | |
stop=["<|endoftext|>", "\n\n==="] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment