by BiteCode_dev · 3y ago · 0 comments
messages=[
GPTMessage(
role=GPTMessageRole.SYSTEM,
content=SYSTEM_PROMPT,
),
GPTMessage(
role=GPTMessageRole.USER,
content="Text: I love this product. It's the best thing ever!",
)
]
Try: messages=(
("system", SYSTEM_PROMPT),
("user", "Text: I love this product. It's the best thing ever!")
)
Or: messages=(
SystemMsg(SYSTEM_PROMPT),
UserMsg("Text: I love this product. It's the best thing ever!")
)
This is still Python, not Java. TYPES: [string, int, bool, float, uuid, datetime, email, url]
RELATIONS: [belongs-to, has-one, has-many, many-to-many]
SCHEMA: """
{
"Datamodel": {
"Name": "<application-name>",
"Models": {
"<model-name>": {
"<field-name>": "<field-type>",
"<field-name>": "<field-type>",
"$relations": {
"<relation-name>": {
"name": "<relation-name>",
"type": "<relation-type>",
"model": "<model-name>"
},
"<relation-name>": {
...
}
}
},
"<model-name>": {
...
}
}
}
}
"""
To let users write things like this: https://twitter.com/verdverm/status/1652504163635347456The important part is that the way messages types are defined is very heavy, and you can get them to be lighter without sacrificing type safety.