How to create unique IDS for files in the Chroma


How to create unique IDS for files in the Chroma We will also create a new collection in Chroma along the way import os import sys from langchain.chains import ConversationalRetrievalChain from langchain.text_splitter import CharacterTextSplitter from langchain_community.document_loaders import PyPDFLoader from langchain_community.document_loaders import Docx2txtLoader from langchain_community.document_loaders import TextLoader from langchain_community.vectorstores import Chroma import uuid from langchain_openai import … Read more

Telegram Bot for Voice-to-Text Transcription with OpenAI


This Python code snippet presents a Telegram bot designed to transcribe voice messages into text using OpenAI’s capabilities. The bot can also calculate the cost associated with processing these voice messages based on their durations. Functions: get_audio_duration(file_path): Description: This asynchronous function retrieves the duration of an audio file in seconds. Parameters: file_path (str) – Path … Read more