Closed rmolinamir closed 1 year ago
Referencing #11
Sorry for the @rmolinamir I've been out of town as well and then I got Covid. Starting to feel better so just now diving into this.
It's interesting that the docs show parameters
as being required. I was going off the code in their node library which had it marked as optional. Makes sense to follow the docs though. Let me look through your PR. Again, sorry for the delay.
Hey, @Stevenic! No need to apologize at all, glad to hear you're better now, COVID sucks. I was also puzzled a little bit when I read their docs and their TypeScript client but decided to go ahead with the docs as the source of truth, but I wonder now If their other clients like the Python SDK are the same. Do you need help with the other open issues?
Hey @Stevenic, hope all is well! Was on a trip so it took me a while to work on this. I thought I was going to have more time to code while traveling, hehe.
The problem is that AlphaWave would attempt to repair the response after
JSONResponseValidator
returns a false negative after parsing theparameters
due to this checkparsed.length == 0
, becauseparsed
is an empty array if theparameters
property is an empty object.The most notable changes are the following:
ChatCompletionFunction
inpackages/alphawave/src/types.ts
. I decided to make theparameters
property required based on the documentation of the function's parameters. Since the onlyPromptCompletionModel
so far is theOpenAIModel
I decided to go ahead, but it could backfire later.'{}'
, theFunctionResponseValidator
sets the content asnull
.null
in theJSONResponseValidator
, then I'm returning a valid validation result to avoid looping during the response repair flow until the max attempts are reached.null
was the most straightforward way to think of something that would make sense and be backward compatible, but there might be better solutions!Let me know what you think.