Name | embcli-gemini JSON |
Version |
0.1.1
JSON |
| download |
home_page | None |
Summary | gemini plugin for embcli |
upload_time | 2025-08-02 05:47:00 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.10 |
license | Apache-2.0 |
keywords |
cli
embeddings
llm
nlp
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# embcli-gemini
[](https://pypi.org/project/embcli-gemini/)


gemini plugin for embcli, a command-line interface for embeddings.
## Reference
- [Gemini Embedding Experimental](https://ai.google.dev/gemini-api/docs/models#gemini-embedding)
- [Gemini Text Embedding and Embedding](https://ai.google.dev/gemini-api/docs/models#text-embedding)
## Installation
```bash
pip install embcli-gemini
```
## Quick Start
You need Gemini API key to use this plugin. Set `GEMINI_API_KEY` environment variable in `.env` file in the current directory. Or you can give the env file path by `-e` option.
```bash
cat .env
GEMINI_API_KEY=<YOUR_GEMINI_KEY>
```
### Try out the Embedding Models
```bash
# show general usage of emb command.
emb --help
# list all available models.
emb models
GeminiEmbeddingModel
Vendor: gemini
Models:
* gemini-embedding-exp-03-07 (aliases: exp-03-07)
* text-embedding-004 (aliases: text-004)
* embedding-001 (aliases: )
Model Options:
* task_type (str) - The type of task for the embedding. Supported task types: 'semantic_similarity', 'classification', 'clustering', 'retrieval_document', 'retrieval_query', 'question_answering', 'fact_verification', 'code_retrieval_query'
# get an embedding for an input text by text-embedding-004 model.
emb embed -m text-004 "Embeddings are essential for semantic search and RAG apps."
# get an embedding for an input text by text-embedding-004 model with task_type=retrieval_query.
emb embed -m text-004 "Embeddings are essential for semantic search and RAG apps." -o task_type retrieval_query
# calculate similarity score between two texts by text-embedding-004 model. the default metric is cosine similarity.
emb simscore -m text-004 "The cat drifts toward sleep." "Sleep dances in the cat's eyes."
0.8025767622661093
```
### Document Indexing and Search
You can use the `emb` command to index documents and perform search by an image. `emb` uses [`LanceDB`](https://github.com/lancedb/lancedb) for the default vector database.
```bash
# index example documents in the current directory.
emb ingest-sample -m text-004 -c catcafe --corpus cat-names-en
# or, you can give the path to your documents.
# the documents should be in a CSV file with two columns: id and text. the separator should be comma.
emb ingest -m text-004 -c catcafe -f <path-to-your-documents>
# search for a query in the indexed documents.
emb search -m text-004 -c catcafe -q "Who's the naughtiest one?"
Found 5 results:
Score: 0.5264116432711389, Document ID: 28, Text: Loki: Loki is a mischievous and clever cat, always finding new ways to entertain himself, sometimes at his humans' expense. He is a master of stealth and surprise attacks on toys. Despite his playful trickery, Loki is incredibly charming and affectionate, easily winning hearts with his roguish appeal.
Score: 0.5167245254962557, Document ID: 46, Text: Bandit: Bandit is a mischievous cat, often with mask-like markings, always on the lookout for his next playful heist of a toy or treat. He is clever and energetic, loving to chase and pounce. Despite his roguish name, Bandit is a loving companion who enjoys a good cuddle after his adventures.
Score: 0.5093414700625404, Document ID: 76, Text: Frankie: Frankie is a boisterous and playful cat, full of charm and mischief. He loves to zoom around the house and engage in energetic play sessions, especially with crinkly toys. Frankie is also very affectionate, often seeking out his humans for cuddles and purrs after his bursts of energy, a fun-loving friend.
Score: 0.5047165435030156, Document ID: 97, Text: Alfie: Alfie is a cheerful and mischievous little cat, always getting into playful trouble with a charming innocence. He loves exploring small spaces and batting at dangling objects. Alfie is incredibly affectionate, quick to purr and eager for cuddles, a delightful bundle of joy and entertainment for his humans.
Score: 0.5034822716772406, Document ID: 71, Text: Archie: Archie is a friendly and slightly goofy ginger cat, always up for a bit of fun and a good meal. He is very sociable and loves attention from anyone willing to give it. Archie enjoys playful wrestling and will often follow his humans around, offering cheerful chirps and affectionate head-bumps.
# multilingual search
emb search -m text-004 -c catcafe -q "一番のいたずら者は誰?"
Found 5 results:
Score: 0.45721307081132867, Document ID: 33, Text: Sophie: Sophie is a refined and intelligent cat, perhaps a Russian Blue, with a gentle demeanor. She is observant and thoughtful, often studying her surroundings before acting. Sophie enjoys quiet playtime and affectionate cuddles on her own terms, forming deep and meaningful bonds with her chosen humans with quiet grace.
Score: 0.45709408404668733, Document ID: 11, Text: Shadow: Shadow is a mysterious black cat, often materializing silently beside you. He enjoys quiet observation from hidden spots, his golden eyes keenly watching everything. Though initially reserved, Shadow forms deep bonds, offering gentle head-bumps and soft purrs to those he trusts, an enigmatic yet loving companion.
Score: 0.4557563703472538, Document ID: 98, Text: Bianca: Bianca, meaning white, is often a beautiful pure white cat with an air of serene elegance. She enjoys quiet, sunlit naps and gentle affection, her purrs like soft whispers. Bianca is a calming presence, bringing a touch of grace and peacefulness to her home, a truly lovely companion.
Score: 0.4550888159070766, Document ID: 10, Text: Mochi: Mochi is a delightfully round and fluffy cat, as sweet and soft as her namesake. She is a champion napper, always seeking the warmest, coziest spot for a snooze. A true lap cat, Mochi's gentle purr is a constant, comforting presence, and she adores soft pets and chin scratches.
Score: 0.4550626224506026, Document ID: 1, Text: Nimbus: Nimbus, with his voluminous, cloud-like white fur, embodies serene gentleness. He is an affectionate companion, delighting in long, quiet cuddle sessions and purring contentedly. Often found observing the world from a sunny windowsill, his calm demeanor makes him a peaceful presence, a truly tranquil friend who enjoys soft pets.
```
## Development
See the [main README](https://github.com/mocobeta/embcli/blob/main/README.md) for general development instructions.
### Run Tests
You need to have a Gemini API key to run the tests for the `embcli-gemini` package. You can set it up as an environment variable:
```bash
GEMINI_API_KEY=<YOUR_GEMINI_KEY> RUN_GEMINI_TESTS=1 uv run --package embcli-gemini pytest packages/embcli-gemini/tests/
```
### Run Linter and Formatter
```bash
uv run ruff check --fix packages/embcli-gemini
uv run ruff format packages/embcli-gemini
```
### Run Type Checker
```bash
uv run --package embcli-gemini pyright packages/embcli-gemini
```
## Build
```bash
uv build --package embcli-gemini
```
## License
Apache License 2.0
Raw data
{
"_id": null,
"home_page": null,
"name": "embcli-gemini",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "cli, embeddings, llm, nlp",
"author": null,
"author_email": "Tomoko Uchida <tomoko.uchida.1111@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/e2/3a/c384fb24fc50427bf60c8a18e6158259740363b664d6b4755c9a13ccbed5/embcli_gemini-0.1.1.tar.gz",
"platform": null,
"description": "# embcli-gemini\n\n[](https://pypi.org/project/embcli-gemini/)\n\n\n\ngemini plugin for embcli, a command-line interface for embeddings.\n\n## Reference\n\n- [Gemini Embedding Experimental](https://ai.google.dev/gemini-api/docs/models#gemini-embedding)\n- [Gemini Text Embedding and Embedding](https://ai.google.dev/gemini-api/docs/models#text-embedding)\n\n## Installation\n\n```bash\npip install embcli-gemini\n```\n\n## Quick Start\n\nYou need Gemini API key to use this plugin. Set `GEMINI_API_KEY` environment variable in `.env` file in the current directory. Or you can give the env file path by `-e` option.\n\n```bash\ncat .env\nGEMINI_API_KEY=<YOUR_GEMINI_KEY>\n```\n\n### Try out the Embedding Models\n\n```bash\n# show general usage of emb command.\nemb --help\n\n# list all available models.\nemb models\nGeminiEmbeddingModel\n Vendor: gemini\n Models:\n * gemini-embedding-exp-03-07 (aliases: exp-03-07)\n * text-embedding-004 (aliases: text-004)\n * embedding-001 (aliases: )\n Model Options:\n * task_type (str) - The type of task for the embedding. Supported task types: 'semantic_similarity', 'classification', 'clustering', 'retrieval_document', 'retrieval_query', 'question_answering', 'fact_verification', 'code_retrieval_query'\n\n# get an embedding for an input text by text-embedding-004 model.\nemb embed -m text-004 \"Embeddings are essential for semantic search and RAG apps.\"\n\n# get an embedding for an input text by text-embedding-004 model with task_type=retrieval_query.\nemb embed -m text-004 \"Embeddings are essential for semantic search and RAG apps.\" -o task_type retrieval_query\n\n# calculate similarity score between two texts by text-embedding-004 model. the default metric is cosine similarity.\nemb simscore -m text-004 \"The cat drifts toward sleep.\" \"Sleep dances in the cat's eyes.\"\n0.8025767622661093\n```\n\n### Document Indexing and Search\n\nYou can use the `emb` command to index documents and perform search by an image. `emb` uses [`LanceDB`](https://github.com/lancedb/lancedb) for the default vector database.\n\n```bash\n# index example documents in the current directory.\nemb ingest-sample -m text-004 -c catcafe --corpus cat-names-en\n\n# or, you can give the path to your documents.\n# the documents should be in a CSV file with two columns: id and text. the separator should be comma.\nemb ingest -m text-004 -c catcafe -f <path-to-your-documents>\n\n# search for a query in the indexed documents.\nemb search -m text-004 -c catcafe -q \"Who's the naughtiest one?\"\nFound 5 results:\nScore: 0.5264116432711389, Document ID: 28, Text: Loki: Loki is a mischievous and clever cat, always finding new ways to entertain himself, sometimes at his humans' expense. He is a master of stealth and surprise attacks on toys. Despite his playful trickery, Loki is incredibly charming and affectionate, easily winning hearts with his roguish appeal.\nScore: 0.5167245254962557, Document ID: 46, Text: Bandit: Bandit is a mischievous cat, often with mask-like markings, always on the lookout for his next playful heist of a toy or treat. He is clever and energetic, loving to chase and pounce. Despite his roguish name, Bandit is a loving companion who enjoys a good cuddle after his adventures.\nScore: 0.5093414700625404, Document ID: 76, Text: Frankie: Frankie is a boisterous and playful cat, full of charm and mischief. He loves to zoom around the house and engage in energetic play sessions, especially with crinkly toys. Frankie is also very affectionate, often seeking out his humans for cuddles and purrs after his bursts of energy, a fun-loving friend.\nScore: 0.5047165435030156, Document ID: 97, Text: Alfie: Alfie is a cheerful and mischievous little cat, always getting into playful trouble with a charming innocence. He loves exploring small spaces and batting at dangling objects. Alfie is incredibly affectionate, quick to purr and eager for cuddles, a delightful bundle of joy and entertainment for his humans.\nScore: 0.5034822716772406, Document ID: 71, Text: Archie: Archie is a friendly and slightly goofy ginger cat, always up for a bit of fun and a good meal. He is very sociable and loves attention from anyone willing to give it. Archie enjoys playful wrestling and will often follow his humans around, offering cheerful chirps and affectionate head-bumps.\n\n# multilingual search\nemb search -m text-004 -c catcafe -q \"\u4e00\u756a\u306e\u3044\u305f\u305a\u3089\u8005\u306f\u8ab0?\"\nFound 5 results:\nScore: 0.45721307081132867, Document ID: 33, Text: Sophie: Sophie is a refined and intelligent cat, perhaps a Russian Blue, with a gentle demeanor. She is observant and thoughtful, often studying her surroundings before acting. Sophie enjoys quiet playtime and affectionate cuddles on her own terms, forming deep and meaningful bonds with her chosen humans with quiet grace.\nScore: 0.45709408404668733, Document ID: 11, Text: Shadow: Shadow is a mysterious black cat, often materializing silently beside you. He enjoys quiet observation from hidden spots, his golden eyes keenly watching everything. Though initially reserved, Shadow forms deep bonds, offering gentle head-bumps and soft purrs to those he trusts, an enigmatic yet loving companion.\nScore: 0.4557563703472538, Document ID: 98, Text: Bianca: Bianca, meaning white, is often a beautiful pure white cat with an air of serene elegance. She enjoys quiet, sunlit naps and gentle affection, her purrs like soft whispers. Bianca is a calming presence, bringing a touch of grace and peacefulness to her home, a truly lovely companion.\nScore: 0.4550888159070766, Document ID: 10, Text: Mochi: Mochi is a delightfully round and fluffy cat, as sweet and soft as her namesake. She is a champion napper, always seeking the warmest, coziest spot for a snooze. A true lap cat, Mochi's gentle purr is a constant, comforting presence, and she adores soft pets and chin scratches.\nScore: 0.4550626224506026, Document ID: 1, Text: Nimbus: Nimbus, with his voluminous, cloud-like white fur, embodies serene gentleness. He is an affectionate companion, delighting in long, quiet cuddle sessions and purring contentedly. Often found observing the world from a sunny windowsill, his calm demeanor makes him a peaceful presence, a truly tranquil friend who enjoys soft pets.\n```\n\n\n## Development\n\nSee the [main README](https://github.com/mocobeta/embcli/blob/main/README.md) for general development instructions.\n\n### Run Tests\n\nYou need to have a Gemini API key to run the tests for the `embcli-gemini` package. You can set it up as an environment variable:\n\n```bash\nGEMINI_API_KEY=<YOUR_GEMINI_KEY> RUN_GEMINI_TESTS=1 uv run --package embcli-gemini pytest packages/embcli-gemini/tests/\n```\n\n### Run Linter and Formatter\n\n```bash\nuv run ruff check --fix packages/embcli-gemini\nuv run ruff format packages/embcli-gemini\n```\n\n### Run Type Checker\n\n```bash\nuv run --package embcli-gemini pyright packages/embcli-gemini\n```\n\n## Build\n\n```bash\nuv build --package embcli-gemini\n```\n\n## License\n\nApache License 2.0\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "gemini plugin for embcli",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://embcli.mocobeta.dev/",
"Repository": "https://github.com/mocobeta/embcli"
},
"split_keywords": [
"cli",
" embeddings",
" llm",
" nlp"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "11fbce6ebd05025011eec648da84547d0d008185e2307e231b1b4a28725283e8",
"md5": "7799a8b28d9929a8417c5bf4e3d26085",
"sha256": "f07e8ea711d177c754305d929d49602db82806c30135c7ce2081eeb88fece7d8"
},
"downloads": -1,
"filename": "embcli_gemini-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7799a8b28d9929a8417c5bf4e3d26085",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 5821,
"upload_time": "2025-08-02T05:46:59",
"upload_time_iso_8601": "2025-08-02T05:46:59.737761Z",
"url": "https://files.pythonhosted.org/packages/11/fb/ce6ebd05025011eec648da84547d0d008185e2307e231b1b4a28725283e8/embcli_gemini-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e23ac384fb24fc50427bf60c8a18e6158259740363b664d6b4755c9a13ccbed5",
"md5": "d1c64b25f289b1700c7568a9e20593df",
"sha256": "ad8f8fbc273026b88a71e53c03b5bd3eb3eb02ac8053e7792a757bf74855ac60"
},
"downloads": -1,
"filename": "embcli_gemini-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "d1c64b25f289b1700c7568a9e20593df",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 5858,
"upload_time": "2025-08-02T05:47:00",
"upload_time_iso_8601": "2025-08-02T05:47:00.924011Z",
"url": "https://files.pythonhosted.org/packages/e2/3a/c384fb24fc50427bf60c8a18e6158259740363b664d6b4755c9a13ccbed5/embcli_gemini-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-02 05:47:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mocobeta",
"github_project": "embcli",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "embcli-gemini"
}