refactor: message content (#1424)

This commit is contained in:
yetone
2025-02-28 14:43:39 +08:00
committed by GitHub
parent ebadba7420
commit ae8497faf1
10 changed files with 187 additions and 125 deletions

View File

@@ -78,7 +78,10 @@ function Suggestion:suggest()
local history_messages = {
{
role = "user",
content = [[
content = {
{
type = "text",
text = [[
<filepath>a.py</filepath>
<code>
L1: def fib
@@ -87,7 +90,9 @@ L3: if __name__ == "__main__":
L4: # just pass
L5: pass
</code>
]],
]],
},
},
},
{
role = "assistant",
@@ -95,7 +100,12 @@ L5: pass
},
{
role = "user",
content = '<question>{"insertSpaces":true,"tabSize":4,"indentSize":4,"position":{"row":1,"col":7}}</question>',
content = {
{
type = "text",
text = '<question>{"insertSpaces":true,"tabSize":4,"indentSize":4,"position":{"row":1,"col":7}}</question>',
},
},
},
{
role = "assistant",
@@ -126,7 +136,7 @@ L5: pass
},
]
]
]],
]],
},
}