langchaingo
langchaingo copied to clipboard
`outputparser.NewStructured` is restrictive & not robust enough
right now, outputparser.NewStructured is based on an internal struct (https://github.com/tmc/langchaingo/blob/main/outputparser/structured.go#L36) that's restrictive to only strings and output values, but I think it should be user-defined, a good example is from vector store here (https://github.com/tmc/langchaingo/blob/main/vectorstores/options.go#L30)
I can create a PR if this is the right way to go
Workaround
for now, I defined a custom prompt with the fields I need with a custom OutputParser and fed the prompt directly to the chain.
Yeah I agree -- making this more flexible would be welcomed.