| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
GenAILib.JSON
Synopsis
- customJSONOptions :: Options
- flattenOptions :: Value -> Value
- jsonToText :: Value -> Text
Documentation
flattenOptions :: Value -> Value Source #
Most LLM back-ends expect the options like temperature to be at the top-level of the object. This function will move the options Object up and merge it with the other keys, removing the options Object as well.
Used internally by this library to construct LLM request bodies
This
{ "foo" : 1 , "bar" : 5 , "options" : { "bar" : 2, "baz" : 3 } }Becomes this
{ "foo" : 1 , "bar" : 2 , "baz" : 3 }jsonToText :: Value -> Text Source #
Convenience function to textify a JSON Value