diff --git a/oasis b/oasis new file mode 160000 index 0000000..8eeb8dd --- /dev/null +++ b/oasis @@ -0,0 +1 @@ +Subproject commit 8eeb8dd0c73494eea1d6dc8f9bfe0e43953d2b99 diff --git a/requirements.txt b/requirements.txt index 72a267c..cc8e08a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,15 +1,15 @@ -pydantic -python-dotenv -google-genai -repo-to-text +pydantic==2.11.7 +python-dotenv==0.21.1 +google-genai==0.1.0 +repo-to-text==0.7.0 PyLD -rdflib -rdflib-jsonld -tiktoken -fastapi -uvicorn +rdflib==6.2.0 +rdflib-jsonld==0.6.2 +tiktoken==0.9.0 +fastapi==0.115.13 +uvicorn==0.34.3 gimie==0.7.2 pyyaml -openai -beautifulsoup4 -selenium \ No newline at end of file +openai==1.91.0 +beautifulsoup4==4.13.4 +selenium==4.34.2 \ No newline at end of file diff --git a/src/api.py b/src/api.py index b1426d2..432bb19 100644 --- a/src/api.py +++ b/src/api.py @@ -23,16 +23,14 @@ async def extract(full_path:str): jsonld_gimie_data = extract_gimie(full_path, format="json-ld") try: - llm_result = await llm_request_repo_infos(str(full_path), output_format="json-ld", max_tokens=20000) - except Exception as e: - raise HTTPException( - status_code=424, - detail=f"Error from LLM service: {e}" - ) + llm_result = await llm_request_repo_infos(str(full_path), output_format="json-ld", max_tokens=30000) + merged_results = merge_jsonld(jsonld_gimie_data, llm_result) + pydantic_data = convert_jsonld_to_pydantic(merged_results["@graph"]) - merged_results = merge_jsonld(jsonld_gimie_data, llm_result) + except Exception as e: - pydantic_data = convert_jsonld_to_pydantic(merged_results["@graph"]) + pydantic_data = convert_jsonld_to_pydantic(jsonld_gimie_data["@graph"]) + print(f"Warning: LLM service failed, using fallback data: {e}") zod_data = convert_pydantic_to_zod_form_dict(pydantic_data) diff --git a/src/core/genai_model.py b/src/core/genai_model.py index 8ec229a..d2e0969 100644 --- a/src/core/genai_model.py +++ b/src/core/genai_model.py @@ -106,7 +106,7 @@ async def clone_repo(repo_url, temp_dir): logger.info(f"Cloning {repo_url} into {temp_dir}...") try: process = await asyncio.create_subprocess_exec( - 'git', 'clone', repo_url, temp_dir, + 'git', 'clone', '-c', 'core.symlinks=false', repo_url, temp_dir, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE )