Introduce prompt template for Python
This MR introduces the prompt template for Python by implementing:
-
PromptTemplate
andPromptTemplateFewShot
to construct generic templates with/without examples -
ModelEngineCodegen
andModelEnginePalm
to build the prompts and clean model outputs depending on the model
All pre/post-process operations have been moved to suggestions/processing/ops
.
The codesuggestions/_assets
folder now contains the prompt templates and examples per language. We can support new languages by simply adding relevant examples to the _assets
folder.
Recommendations without prompt template:
from pydantic import BaseModel
# class with two fields name and description
class Item(BaseModel):
name: str
description: str
# class with two fields name and description
Recommendations with prompt template:
from pydantic import BaseModel
# class with two fields name and description
class Person(BaseModel):
name: str
description: str
Closes #96 (closed)
Edited by Alexander Chueshev