From f4c2abbcd9bf804e5ca1fccdb574badc2b2fb2ad Mon Sep 17 00:00:00 2001 From: Amitai Frey Date: Fri, 13 Sep 2024 03:16:37 +0300 Subject: [PATCH] outputparser: improve DefinedOutputParser (#980) The DefinedOutputParser prompted the LLM with a Typescript schema, but expected a json in response: https://github.com/tmc/langchaingo/blob/1975058648b5914fdd9dc53434c5b59f219e2b5c/outputparser/defined.go\#L65-69 Now it also requests a json. --- outputparser/defined.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outputparser/defined.go b/outputparser/defined.go index e56a6a6f5..138055566 100644 --- a/outputparser/defined.go +++ b/outputparser/defined.go @@ -53,7 +53,7 @@ var _ schema.OutputParser[any] = Defined[any]{} // GetFormatInstructions returns a string describing the format of the output. func (p Defined[T]) GetFormatInstructions() string { - const instructions = "Your output should be in JSON, structured according to this TypeScript:\n```typescript\n%s\n```" + const instructions = "Your output should be in JSON, structured according to this schema:\n```json\n%s\n```" return fmt.Sprintf(instructions, p.schema) }