This application is a web server built with FastAPI. It provides an endpoint /get_location that fetches location data based on latitude and longitude using the Google Maps API. When a POST request is made to the /get_location endpoint with latitude and longitude as form data, the application returns the location data in JSON format. The application requires a Google Maps API key to function. This key should be provided via the environment variable GOOGLE_MAPS_API_KEY
This API will classify incoming text items into categories using the GPT 4 model. If the model is unsure about the category of a text item, it will respond with an empty string. The categories are parameters that the API endpoint accepts. The GPT 4 model will classify the items on its own with a prompt like this: "Classify the following item {item} into one of these categories {categories}". There is no maximum number of categories a text item can belong to in the multiple categories classification. The API will use the llm_prompt ability to ask the LLM to classify the item and respond with the category. The API will take the LLM's response as is and will not handle situations where the model identifies multiple categories for a text item in the single category classification. If the model is unsure about the category of a text item in the multiple categories classification, it will respond with an empty string for that item. The API will use Python's concurrent.futures module to parallelize the classification of text items. The API will handle timeouts and exceptions by leaving the items unclassified. The API will parse the LLM's response for the multiple categories classification and match it to the list of categories provided in the API parameters. The API will convert the LLM's response and the categories to lowercase before matching them. The API will split the LLM's response on both ':' and ',' to remove the "Category" word from the response. The temperature of the GPT model is set to a minimal value to make the output more deterministic. The API will return all matching categories for a text item in the multiple categories classification. The API will strip any leading or trailing whitespace from the categories in the LLM's response before matching them to the list of categories provided in the API parameters. The API will accept lists as answers from the LLM. If the LLM responds with a string that's formatted like a list, the API will parse it and match it to the list of categories provided in the API parameters.
This app integrates a custom Stripe checkout page in a Python application. It includes both a backend and a frontend. The backend service is set up using FastAPI and is compatible with any price point established through the Stripe API. The backend service creates a Stripe checkout session and retrieves the status of a checkout session. It also allows all CORS and logs sent requests and checkout session statuses. The price ID is fetched during the request from the user. After adding the Stripe API key and directing the backend service to the price ID, the backend service can be activated by clicking the test button. The frontend code can be integrated into a Python application to create a custom payment page. This method can be used to set up various types of payment pages, including one-time payments and subscriptions. The required environment secrets for this app are STRIPE_SECRET_KEY and YOUR_DOMAIN.
Lazy apps can be helpful in the Data Enrichment category by automating and streamlining the process of gathering and enhancing data. Here are a few ways lazy apps can assist in data enrichment:
Overall, lazy apps in the Data Enrichment category can significantly reduce manual effort, improve data quality, and provide valuable insights for businesses and organizations.