Skip to content

Commit

Permalink
Merge pull request #56 from DigitalProductInnovationAndDevelopment/fi…
Browse files Browse the repository at this point in the history
…x/preferences

fix preferences input
  • Loading branch information
ishworgiri1999 authored Aug 7, 2024
2 parents 346b735 + bd78ef8 commit c94280d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .env.docker.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ POSTGRES_PASSWORD=postgres

REDIS_ENDPOINT=redis://redis:6379/0

ENVIRONMENT=development
ENVIRONMENT=production

AI_STRATEGY=OLLAMA #OLLAMA,OPENAI,ANTHROPIC

Expand Down
7 changes: 5 additions & 2 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ def health():
"uptime": round(time.time() - start_time, 2),
"external_modules": {"ollama": ollama_health},
"urls": {
# "llm": llm_service.get_url(),
"redis": config.redis_endpoint,
"redis": (
config.redis_endpoint
if config.environment == "development"
else "retracted"
),
# this leaks the db user and password in dev mode
"postgres": (
config.get_db_url()
Expand Down
6 changes: 3 additions & 3 deletions src/routes/v1/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ async def upload(
finding_repository.create_findings(findings)
worker_input = GenerateReportInput(
recommendation_task_id=recommendation_task.id,
generate_long_solution=data.preferences.long_description or True,
generate_search_terms=data.preferences.search_terms or True,
generate_aggregate_solutions=data.preferences.aggregated_solutions or True,
generate_long_solution=data.preferences.long_description,
generate_search_terms=data.preferences.search_terms,
generate_aggregate_solutions=data.preferences.aggregated_solutions,
)

celery_result = worker.send_task(
Expand Down
2 changes: 1 addition & 1 deletion src/test/mock_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_url(self) -> str:
return self.generate_url

def _generate(self, prompt: str, json=True) -> Dict[str, str]:
print(prompt)
# TODO: Mock Aggregated Solution Responses and Subdivision Responses
print(f"{answer_in_json_prompt('recommendation')}".format())
if f"{answer_in_json_prompt('combined_description').format()}" in prompt:
return {"combined_description": "combined_description"}
Expand Down

0 comments on commit c94280d

Please sign in to comment.