{"id":19675434,"url":"https://github.com/langroid/langroid-client","last_synced_at":"2026-06-06T21:31:17.291Z","repository":{"id":225909999,"uuid":"767055214","full_name":"langroid/langroid-client","owner":"langroid","description":"Python client for Langroid REST API services","archived":false,"fork":false,"pushed_at":"2024-06-09T17:42:07.000Z","size":1847,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-21T22:25:15.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/langroid.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}},"created_at":"2024-03-04T16:15:07.000Z","updated_at":"2024-06-09T17:42:10.000Z","dependencies_parsed_at":"2024-06-09T17:38:56.562Z","dependency_job_id":"e1e27647-1b6f-435b-a4c9-93b8c0ccd6b9","html_url":"https://github.com/langroid/langroid-client","commit_stats":null,"previous_names":["langroid/langroid-client"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/langroid/langroid-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langroid%2Flangroid-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langroid%2Flangroid-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langroid%2Flangroid-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langroid%2Flangroid-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/langroid","download_url":"https://codeload.github.com/langroid/langroid-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/langroid%2Flangroid-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34001197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-11T17:23:58.064Z","updated_at":"2026-06-06T21:31:17.237Z","avatar_url":"https://github.com/langroid.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Langroid API Client\n\nPython client for Langroid REST API.\n\n## Installation\n\nWork in a virtual environment, and use Python 3.11.\n\n```bash\npython3 -m venv .venv\n. ./.venv/bin/activate\npip install langroid-client\n```\n\n## Environment Setup\n\nHave your OpenAI API Key ready (it should be gpt-4 capable).\n\nSet these env vars in your `.env` file placed in the root of this repo.\n\n```bash\nOPENAI_API_KEY=your-api-key-with-no-quotes\nINTELLILANG_BASE_URL=\"https://langroid-server-zb43tal5mq-uk.a.run.app\"\n```\n\n## Run the example script\n\nRun this from the root of this repository as follows. The above environment\nvars will be automatically loaded from the `.env` file.\n\nLook into this example script to see how to use the client (also see details below).\n\n```bash\npython3 examples/example_usage.py\n```\n\nOr if you don't have an `.env` file, you can pass the vars directly at the cmd line:\n\n```bash\nINTELLILANG_BASE_URL=\"https://langroid-server-zb43tal5mq-uk.a.run.app\" \\\n    OPENAI_API_KEY=your-api-key-with-no-quotes \\    \n    python3 examples/example_usage.py\n```\n\n# Usage of the Python API client\n\nBefore using these, first set up the `Client` object, using the `INTELLILANG_BASE_URL` env var.\n\nNote, the API handles docs in a variety of formats-- pdf, doc, docx, txt.\n\n```python\nfrom langroid_client import LangroidClient\nclient = LangroidClient(INTELLILANG_BASE_URL)\n```\n### Extract requirements\n\n```python\nsuccess, reqs_jsonl = client.intellilang_extract_reqs(\n    reqs_path=\"path/to/requirements.pdf\", # the requirements document to extract from\n    candidate_path=\"path/to/candidate.pdf\", # example of a candidate/proposal file\n    params={\"num\": 3}, # number of requirements to extract\n    openai_api_key=\"your-api-key\",\n    doc_type=\"rfp\", # or \"resume\"\n)\n    \"\"\"\n    Extract requirements from a specification document.\n\n    Args:\n        reqs_path (str): Path to the requirements document.\n        candidate_path (str): Path to the candidate document.\n        params (Dict[str, Any]): Extraction parameters.\n        openai_api_key (str): OpenAI API key.\n        doc_type (str): Type of document (rfp or resume).\n\n    Returns:\n        Tuple[bool, bytes|str]:\n            A tuple containing a boolean indicating success and the extracted\n            requirements in jsonl format\n    \"\"\"\n```\n\nThe returned `success` is a bool flag indicating success or not.\n\n### Save requirements to a `jsonl` format file\n\n```python\nextracted_reqs_jsonl = \"/tmp/out.jsonl\"\nwith open(reqs_jsonl, \"wb\") as output_file:\n    output_file.write(reqs_jsonl)\n```\n\n### Evaluate candidate docs w.r.t. extracted reqs\n\n```python\nimport json\nsuccess, (scores, evals) = client.intellilang_eval(\n    extracted_reqs_jsonl, # above extracted requirements jsonl file\n    [\"/path/to/candidate1.pdf\", \"/path/to/candidate2.pdf\"], # list of candidate files\n    params=dict(start_idx=1, cost=30.0), # leave these as a default\n    openai_api_key=\"openai-api-key\",\n    doc_type=\"rfp\",\n)\n\"\"\"\nEvaluate candidates based on extracted requirements.\n\nArgs:\n    reqs_path (str): Path to the extracted requirements file (jsonl file)\n    candidate_paths (List[str]): Paths to the candidate documents.\n    params (Dict[str, Any]): Evaluation parameters.\n    openai_api_key (str): OpenAI API key.\n    doc_type (str): Type of document (rfp or resume).\n\nReturns:\nTuple[bool, Tuple[List[Dict[str, Any]], List[Dict[str, Any]] | str]:\n            A tuple containing a boolean indicating success and tuple\nof lists of scores and evaluations\n\"\"\"\n```\n\nBesides the `success` flag, a tuple of two list-of-dicts is returned:\n\n- `scores` represents the synopsis table of scores of all candidates\n- `evals` represents a table containing detailed evals of all candidates\n  (best to look at the example output to understand the structure)\n\n```python\nprint(f\"success: {success}\")\n# print scores\nprint(\"Scores:\")\nfor score in scores:\n    print(json.dumps(score))\n\n# print evals\nprint(\"Evaluations:\")\nfor eval in evals:\n    print(json.dumps(eval))\n```\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangroid%2Flangroid-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flangroid%2Flangroid-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flangroid%2Flangroid-client/lists"}