TopicAI & Automation
Chatbots, LLM apps, workflow automation and integrations that actually work.
Short answer: To support pgvector different embedding dimensions, use one table per model and dimension, each with a typed vector(N) column and its own HNSW index. Untyped columns work only with partial expression indexes.
Read the full answer
Short answer: To langchain chroma get embeddings, call vectorstore.get(include=['embeddings','documents','metadatas']). Chroma omits vectors by default, so 'embeddings: None' is expected behaviour, not a bug, and the vectors are stored.
Read the full answer
Short answer: For openai async api calls in Python, use AsyncOpenAI and await client.chat.completions.create(). The TypeError appears because you awaited a synchronous call that already returned a finished, non-awaitable object.
Read the full answer
Short answer: To use a langchain custom embedding model, subclass Embeddings from langchain_core.embeddings and implement embed_documents and embed_query, both returning plain Python lists of floats, then pass an instance to Chroma.
Read the full answer
Short answer: LLM parameters vs weights: parameters are every learned number in a model (weights, biases, norm scales, embeddings), while weights are the multiplicative matrices that make up almost all of them, so the terms are often used interchangeably.
Read the full answer
Short answer: GPT-4 API access not working almost always means the key's account, project or tier cannot use that model name, not that your ChatGPT Plus plan failed, because Plus and the API are billed separately. Check the exact error code first.
Read the full answer
Short answer: To get all documents from ChromaDB, call collection.get() (or LangChain's vectorstore.get()) with include=['documents','metadatas','embeddings']; ids always come back, and for large collections page with limit and offset.
Read the full answer
Short answer: To combine a LangChain ConversationalRetrievalChain custom prompt with memory, pass the memory object and put your QA prompt in combine_docs_chain_kwargs. For new code, use create_history_aware_retriever instead.
Read the full answer
Short answer: LangChain CharacterTextSplitter chunk_size not working is expected: it is a target for merging pieces, not a hard cap. It never cuts inside a piece, so text without the separator comes back as one oversized chunk.
Read the full answer
Short answer: Why BERT has no decoder: it is an encoder-only Transformer built to understand text, not generate it. Predictions come from small task heads on its outputs, such as a fill-in-the-blank MLM head or a classifier on [CLS].
Read the full answer
Short answer: The ChatCompletion object is not subscriptable error appears because openai>=1.0.0 returns Pydantic objects, not dicts. Change response['choices'][0]['message']['content'] to response.choices[0].message.content.
Read the full answer
Short answer: The LangChain issubclass TypeError means a dependency in the import chain, usually pydantic, typing_extensions, typing_inspect or dataclasses_json, has a mismatched version. Fix it in a clean virtual environment on Python 3.10 or newer.
Read the full answer