Skip to content

Commit

Permalink
fix config usage and remove email field
Browse files Browse the repository at this point in the history
  • Loading branch information
a-kore committed Feb 14, 2025
1 parent 28834e9 commit aa9ad4d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 0 additions & 2 deletions docs/source/schema.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ The schema is as follows:
"postal_code": "M5E1 B07",
"country": "Canada"
},
"email": "[email protected]",
"metadata": {
"type": "Medical Clinic",
"languages": [
Expand All @@ -59,5 +58,4 @@ The schema is a JSON object with the following fields:
- ``province``: The province where the service is located.
- ``postal_code``: The postal code of the service location.
- ``country``: The country where the service is located.
- ``email``: The email address of the service.
- ``metadata``: Additional metadata about the service. The metadata object can have any number of fields.
3 changes: 0 additions & 3 deletions health_rec/api/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ class Service(BaseModel):
A list of phone numbers associated with the service.
address : Address
The physical address of the service.
email : str
The email address of the service.
metadata : Dict[str, Any]
Additional metadata associated with the service.
last_updated : Optional[datetime]
Expand All @@ -117,7 +115,6 @@ class Service(BaseModel):
longitude: float
phone_numbers: List[PhoneNumber]
address: Address
email: str

# Optional metadata fields stored as key-value pairs
metadata: Dict[str, Any] = Field(default_factory=dict)
Expand Down
2 changes: 1 addition & 1 deletion health_rec/services/rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def _generate_response(self, query: str, context: str) -> RecommendationResponse

try:
completion = self.client.chat.completions.create(
model="gpt-4o",
model=Config.OPENAI_MODEL,
messages=[
{
"role": "user",
Expand Down
2 changes: 1 addition & 1 deletion health_rec/services/refine.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def improve_query(
"""

completion = self.client.chat.completions.create(
model="gpt-4o",
model=Config.OPENAI_MODEL,
messages=[{"role": "user", "content": prompt}],
max_tokens=300,
)
Expand Down
2 changes: 1 addition & 1 deletion health_rec/services/rerank.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def rerank(
try:
messages = self._create_ranking_prompt(query, services)
completion = self.client.chat.completions.create(
model="gpt-4o",
model=Config.OPENAI_MODEL,
messages=messages, # type: ignore
temperature=0,
)
Expand Down
10 changes: 7 additions & 3 deletions scripts/download_211_data.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Download and process data from the 211 API."""

import argparse
import json
import logging
import math
Expand Down Expand Up @@ -175,8 +176,6 @@ def main() -> None:
"""Main function to run the script."""
load_dotenv("./.env.development")

import argparse

parser = argparse.ArgumentParser(description="Download data from the 211 API.")
parser.add_argument(
"--api-key", default=os.getenv("211_API_KEY"), help="API key for 211 API"
Expand All @@ -186,7 +185,12 @@ def main() -> None:
default="https://data.211support.org/api/v2/search",
help="Base URL for 211 API",
)
parser.add_argument("--dataset", default="on", help="Dataset to download")
parser.add_argument(
"--dataset",
default="211CX",
help="Dataset to download",
choices=["211CX", "on", "nl", "nb"],
)
parser.add_argument(
"--is-gta", action="store_true", help="Whether to download GTA data"
)
Expand Down

0 comments on commit aa9ad4d

Please sign in to comment.