Skip to content

How to use Mistral withStructuredOutput in ConversationalRetrievalQAChain? #5265

Closed Answered by KirioXX
KirioXX asked this question in Q&A
Discussion options

You must be logged in to vote

I figured it out myself. This the updated code:

import { ConversationalRetrievalQAChain } from 'langchain/chains';
import { ChatMistralAI } from '@langchain/mistralai';
import { CheerioWebBaseLoader } from 'langchain/document_loaders/web/cheerio';
import { RecursiveCharacterTextSplitter } from 'langchain/text_splitter';
import { MemoryVectorStore } from 'langchain/vectorstores/memory';
import { MistralAIEmbeddings } from '@langchain/mistralai';

const labelsJsonSchema = {
  type: 'array',
  items: {
    type: 'object',
    properties: {
      name: { type: 'string' },
      description: { type: 'string' },
    },
    required: ['name'],
  },
  description: 'A list of labels for the given …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@KirioXX
Comment options

@dosubot
Comment options

@KirioXX
Comment options

@dosubot
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by KirioXX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant