{"id":37071581,"url":"https://github.com/chigwell/go-concise-summary","last_synced_at":"2026-01-14T08:23:57.964Z","repository":{"id":329751628,"uuid":"1120577225","full_name":"chigwell/go-concise-summary","owner":"chigwell","description":"A new package would take a technical description or code snippet related to concurrency in Go and generate a structured summary of the concept, such as a fair, cancelable semaphore. It would extract k","archived":false,"fork":false,"pushed_at":"2025-12-21T14:11:35.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-23T04:59:35.169Z","etag":null,"topics":["automated-documentation","cancelable","code-analysis","concept-explanation","fairness","go-concurrency","implementation-notes","predefined-format","purpose-extraction","semaphore","structured-summary","text-input","usage-patterns"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/go-concise-summary/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chigwell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-21T14:11:22.000Z","updated_at":"2025-12-21T14:11:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chigwell/go-concise-summary","commit_stats":null,"previous_names":["chigwell/go-concise-summary"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/chigwell/go-concise-summary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fgo-concise-summary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fgo-concise-summary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fgo-concise-summary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fgo-concise-summary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chigwell","download_url":"https://codeload.github.com/chigwell/go-concise-summary/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chigwell%2Fgo-concise-summary/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413871,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:16:59.381Z","status":"ssl_error","status_checked_at":"2026-01-14T08:13:45.490Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automated-documentation","cancelable","code-analysis","concept-explanation","fairness","go-concurrency","implementation-notes","predefined-format","purpose-extraction","semaphore","structured-summary","text-input","usage-patterns"],"created_at":"2026-01-14T08:23:57.186Z","updated_at":"2026-01-14T08:23:57.957Z","avatar_url":"https://github.com/chigwell.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-concise-summary\n[![PyPI version](https://badge.fury.io/py/go-concise-summary.svg)](https://badge.fury.io/py/go-concise-summary)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![Downloads](https://static.pepy.tech/badge/go-concise-summary)](https://pepy.tech/project/go-concise-summary)\n[![LinkedIn](https://img.shields.io/badge/LinkedIn-blue)](https://www.linkedin.com/in/eugene-evstafev-716669181/)\n\n\nA lightweight helper library that takes a technical description or code snippet about Go concurrency concepts and returns a structured, concise summary. It is especially useful for extracting key details such as purpose, usage, and implementation notes from a fair, cancelable semaphore or other concurrency patterns.\n\nThe package is available on PyPI as `go_concise_summary` and works as a drop‑in function that can use the default **ChatLLM7** model or any LangChain compatible LLM.\n\n---\n\n## Installation\n\n```bash\npip install go_concise_summary\n```\n\n---\n\n## Basic Usage\n\n```python\nfrom go_concise_summary import go_concise_summary\n\nuser_text = \"\"\"\nA fair, cancelable semaphore in Go can be implemented using a counting semaphore\npattern with a context for cancellation. Its purpose is to limit concurrent\naccess to a resource while ensuring that waiting goroutines are notified when\nthe semaphore is released or when the context is cancelled.\n\"\"\"\n\nsummary = go_concise_summary(\n    user_input=user_text\n)\n\nprint(summary)\n# Output will be a list of strings matching the expected regex pattern.\n```\n\n---\n\n## Function Signature\n\n```python\ndef go_concise_summary(\n    user_input: str,\n    api_key: Optional[str] = None,\n    llm: Optional[BaseChatModel] = None\n) -\u003e List[str]\n```\n\n| Argument | Type | Description |\n|----------|------|-------------|\n| `user_input` | `str` | The Go concurrency description or code that you want summarized. |\n| `api_key` | `Optional[str]` | API key for the default **ChatLLM7** service. If omitted, the function will look for an environment variable `LLM7_API_KEY`. |\n| `llm` | `Optional[BaseChatModel]` | A LangChain LLM instance. If supplied, the function will use this LLM instead of the default **ChatLLM7**. |\n\n---\n\n## Overriding the LLM\n\nThe library ships with a bundled **ChatLLM7** instance, but you can pass any LangChain LLM that implements `BaseChatModel`.\n\n### OpenAI\n\n```python\nfrom langchain_openai import ChatOpenAI\nfrom go_concise_summary import go_concise_summary\n\nllm = ChatOpenAI()\nsummary = go_concise_summary(user_input=text, llm=llm)\n```\n\n### Anthropic\n\n```python\nfrom langchain_anthropic import ChatAnthropic\nfrom go_concise_summary import go_concise_summary\n\nllm = ChatAnthropic()\nsummary = go_concise_summary(user_input=text, llm=llm)\n```\n\n### Google Gemini\n\n```python\nfrom langchain_google_genai import ChatGoogleGenerativeAI\nfrom go_concise_summary import go_concise_summary\n\nllm = ChatGoogleGenerativeAI()\nsummary = go_concise_summary(user_input=text, llm=llm)\n```\n\n---\n\n## Using a Custom LLM7 API Key\n\nIf you require higher rate limits than the default free tier, create or export an LLM7 API key:\n\n```bash\nexport LLM7_API_KEY=\"your-api-key-here\"\n```\n\nor pass it directly:\n\n```python\nsummary = go_concise_summary(user_input=text, api_key=\"your_api_key_here\")\n```\n\nFree LLM7 API keys can be obtained at \u003chttps://token.llm7.io/\u003e.\n\n---\n\n## How It Works\n\n1. **Prompting** – The function composes a system prompt (`system_prompt`) and a user prompt (`human_prompt`) that instruct the model to produce a concise, structured summary of the Go concurrency snippet.\n2. **LLM Call** – It sends the prompts to the configured LLM.\n3. **Regex Extraction** – Using the pre‑defined `pattern`, the response is validated and formatted. The extracted information is returned as a `List[str]`.\n\n---\n\n## Issues \u0026 Support\n\nFound a bug or have a feature request? Open an issue here:\n\u003chttps://github.com/chigwell/go-concise-summary/issues\u003e\n\n---\n\n## Author\n\n- **Eugene Evstafev**  \n- Email: hi@euegne.plus  \n- GitHub: @chigwell","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchigwell%2Fgo-concise-summary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchigwell%2Fgo-concise-summary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchigwell%2Fgo-concise-summary/lists"}