Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
xmnlab committed Dec 10, 2024
1 parent 1976817 commit 8b7726a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,15 @@ warn_redundant_casts = true
warn_unused_configs = true
show_error_codes = true
exclude = ["scripts/"]
plugins = ["pydantic.mypy"]

[[tool.mypy.overrides]]
module = [
"langchain_experimental.sql",
]
ignore_missing_imports = true

[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
6 changes: 4 additions & 2 deletions src/anamnesisai/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def check_possible_fhir_resources(
)
result = gen.generate(query=text, context=[])
except Exception as e:
logging.degug(str(e))
logging.debug(str(e))
return FHIRResourceFoundModel()

return cast(FHIRResourceFoundModel, result)
Expand All @@ -59,7 +59,9 @@ def extract_fhir(text: str, api_key: str) -> dict[str, Resource]:
resource_name = fhir_class.__name__

if not getattr(possible_fhir, resource_name, False):
logging.debug(str(e))
logging.debug(
f"{resource_name} resource not found in the conversation."
)
continue

resource_detail = get_resource_detail(fhir_class)
Expand Down
5 changes: 4 additions & 1 deletion src/anamnesisai/supported_fhir.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
)

fields = {cls.__name__: (bool, ...) for cls in RESOURCES_CLASSES}
FHIRResourceFoundModel = create_model("FHIRResourceFoundModel", **fields)
FHIRResourceFoundModel = create_model( # type: ignore[call-overload]
"FHIRResourceFoundModel",
**fields,
)

__all__ = [
"RESOURCES_CLASSES",
Expand Down

0 comments on commit 8b7726a

Please sign in to comment.