Y
Hacker News
new
|
ask
|
show
|
jobs
by
trafnar
1066 days ago
It's not clear to me how they ensure the responses will be valid JSON, are they just asking for it, then parsing the result with error checking?
2 comments
esafak
1066 days ago
Yes.
https://github.com/microsoft/TypeChat/blob/main/src/typechat...
link
davnicwil
1066 days ago
seems like they run the generated response through the typescript type checker, and if it fails, retry using the error message as a further hint to the LLM, until it succeeds.
link
anonzzzies
1066 days ago
I would expect that, if it doesn’t do that even, why bother… that is also trivial to do anyway.
link
verdverm
1066 days ago
also some very basic prompt engineering
link