02. Comma SeparatedListOutputParser

CommaSeparatedListOutputParser

CommaSeparatedListOutputParser Is useful when you need to return a comma-separated list of items.

With this output parser, the data entered by the user or the requested information can be separated by commas to be provided in the form of a clear and concise list. For example, when listing multiple data points, names, items, or other types of values, this allows you to effectively organize and pass information to users.

This method structures information, increases readability, and is very useful, especially when dealing with data or requiring results in list form.

Copy

from dotenv import load_dotenv

load_dotenv()

Copy

True

Copy

# LangSmith Set up tracking. https://smith.langchain.com
# !pip install langchain-teddynote
from langchain_teddynote import logging

# Enter a project name.
logging.langsmith("CH03-OutputParser")

Copy

Copy

  • Run the chain and output the results.

Copy

Copy

  • chain.stream Use to repeat the stream for "Korea Tourism".

  • Outputs the result of the stream during iteration.

Copy

Copy

Last updated