Spaces:
Runtime error
Runtime error
File size: 1,771 Bytes
f91510c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
from retrieval.main import get_context
from prompts import layoutPrompt
# use langchain and ingested paper to query for what the jupyter notebook layout should look like
# create functino decorato
def getLayout(arxiv_link: str):
"""
getLayout(url: str) -> layout: list[str]
"""
return get_context(arxiv_link, layoutPrompt)
## for each portion of the layout, generate a simple prompt that can be used to query langchain
def getSectionPrompt(section: str):
"""
getSectionPrompt(section: str) -> prompt: str
"""
return
### for each section of the layout, query langchain to get the portions of the paper that are most relevant to that code section
def getSectionContext(prompt: str):
"""
getSectionContext(prompt: str) -> context: str
"""
return
#### for each code section and provided context, generate the code for that section
def getSectionCode(section: str, context: str):
"""
getSectionCode(section: str, context: str) -> code: str
"""
return
##### for each code section, check formatting, correctness, etc.
def checkSectionCode(code: str):
"""
checkSectionCode(code: str) -> code: str
"""
return
# stitch together and markup all of the code sections to create the final jupyter notebook
def stitchNotebook(layout: list[str], code: list[str]):
"""
stitchNotebook(layout: list[str], code: list[str]) -> notebook: str
"""
return
# check formatting, correctness, etc. of the final jupyter notebook
def checkNotebook(notebook: str):
"""
checkNotebook(notebook: str) -> notebook: str
"""
return
# save the stitched together code as a jupyter notebook
def saveNotebook(notebook: str):
"""
saveNotebook(notebook: str) -> none
"""
return
|