{"id":23974,"library":"llama-index-embeddings-cohere","title":"LlamaIndex Embeddings Cohere","description":"LlamaIndex integration for Cohere embedding models. Current version 0.8.0, requires Python >=3.10 and <4.0. Released as part of the llama-index plugin ecosystem; version bumps may follow llama-index core releases.","status":"active","version":"0.8.0","language":"python","source_language":"en","source_url":"https://github.com/run-llama/llama_index","tags":["llama-index","cohere","embeddings","llm","rag"],"install":[{"cmd":"pip install llama-index-embeddings-cohere","lang":"bash","label":"pip install"}],"dependencies":[{"reason":"Required for base abstractions and embedding interface","package":"llama-index-core","optional":true},{"reason":"Official Cohere Python SDK to interact with Cohere API","package":"cohere","optional":false}],"imports":[{"note":"Correct import path as of version 0.8.0","symbol":"CohereEmbedding","correct":"from llama_index.embeddings.cohere import CohereEmbedding"},{"note":"Direct import from llama_index package not supported; must use submodule path","wrong":"from llama_index import CohereEmbedding","symbol":"CohereEmbedding","correct":"from llama_index.embeddings.cohere import CohereEmbedding"}],"quickstart":{"code":"import os\nfrom llama_index.embeddings.cohere import CohereEmbedding\n\nembed_model = CohereEmbedding(\n    api_key=os.environ.get(\"COHERE_API_KEY\", \"\"),\n    model_name=\"embed-english-v3.0\",\n    input_type=\"search_query\",\n)\nprint(embed_model.get_text_embedding(\"Hello world!\")[:5])","lang":"python","description":"Initialize Cohere embedding model, get a sample embedding."},"warnings":[{"fix":"Use `from llama_index.embeddings.cohere import CohereEmbedding`.","message":"Version 0.8.0 changed import path from `llama_index.embeddings.cohere` (previously may have been `llama_index.embeddings.cohere.base`). Ensure correct import.","severity":"breaking","affected_versions":">=0.8.0"},{"fix":"Remove `embed_batch_size` when constructing CohereEmbedding.","message":"The `embed_batch_size` parameter was removed; batching is now handled automatically.","severity":"deprecated","affected_versions":">=0.8.0"},{"fix":"Always specify `input_type` when calling `get_text_embedding` or during initialization.","message":"Cohere requires `input_type` parameter (e.g., 'search_query', 'search_document', 'classification'). Omitting it may cause errors from the API.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use `from llama_index.embeddings.cohere import CohereEmbedding`.","cause":"Incorrect import path; trying to import directly from the top-level `llama_index` package.","error":"ImportError: cannot import name 'CohereEmbedding' from 'llama_index'"},{"fix":"Pass `input_type` to the embedding call or during initialization.","cause":"Missing `input_type` parameter when using Cohere embedding models that require it (e.g., embed-english-v3.0).","error":"cohere.core.api_error.ApiError: status_code: 400, body: {'message': 'input_type is required'}"},{"fix":"Remove `embed_batch_size` from the constructor arguments.","cause":"The `embed_batch_size` parameter was removed in newer versions of this library.","error":"TypeError: __init__() got an unexpected keyword argument 'embed_batch_size'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}