Replies: 2 comments
-
|
Hi @marinho 👋! I think this is a pretty good idea, as I believe many are using dummy Google account for this. I made Problem is, I don't see an option to migrate the functions ( Couple of example as to why, see this code for async def google_search_text(
q: str, session: SessionDep, current_user: Annotated[str, Depends(get_current_username)]
) -> list[GooglePlaceResult]:
if not q or not q.strip():
raise HTTPException(status_code=400, detail="Bad Request")
api_key = _get_user_api_key(session, current_user)
results = await gmaps_textsearch(q.strip(), api_key)
if not results:
return []
async def _process_result(
place_data: dict,
api_key: str,
) -> GooglePlaceResult | None:
try:
return await result_to_place(place_data, api_key)
except Exception:
return None
return await _process_gmaps_batch(
results,
api_key,
_process_result,
)
One good thing though is that the google parsing functions are currently located in a dedicated So, in my opinion, solution is to:
EDIT: Or I could migrate the providers into Classes (creating a |
Beta Was this translation helpful? Give feedback.
-
|
Hi 👋,
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Not a specific problem, except that I am trying to avoid using Google tools more than I'm enforced too :-)
Describe the solution you'd like
My suggestion here is pretty straight forward: to refactor the
/google-*routes (except*-import) into a model that can support extending to other engines. A first step would be just to make it agnostic, and then whoever wants to support other engines could just file a PR adding their engine of preference.Additional context
I'd be glad to contribute on that change, as long as the suggestion is accepted. I wanted to start with an FR, as I'm new into Trip and I don't know previous history and decisions. Maybe that's already in progress anyhow :)
Beta Was this translation helpful? Give feedback.
All reactions