Setup the Discourse Loader with your community url.
Copy
Ask AI
from embedchain.loaders.discourse import DiscourseLoaderdicourse_loader = DiscourseLoader(config={"domain": "https://community.openai.com"})
Once you setup the loader, you can create an app and load data using the above discourse loader
Copy
Ask AI
import osfrom embedchain.pipeline import Pipeline as Appos.environ["OPENAI_API_KEY"] = "sk-xxx"app = App()app.add("openai after:2023-10-1", data_type="discourse", loader=dicourse_loader)question = "Where can I find the OpenAI API status page?"app.query(question)# Answer: You can find the OpenAI API status page at https:/status.openai.com/.
NOTE: The add function of the app will accept any executable search query to load data. Refer Discourse API Docs to learn more about search queries.
We automatically create a chunker to chunk your discourse data, however if you wish to provide your own chunker class. Here is how you can do that: