diff --git a/README.md b/README.md new file mode 100644 index 0000000..ef350cb --- /dev/null +++ b/README.md @@ -0,0 +1,34 @@ +# Margdarshak + +## Steps to Run + +To run the project, use the following commands: + +```sh +# Run the project +API_KEY= cargo run +``` + +## The project uses the following dependencies: + +- `anyhow`: For error handling. +- `async-trait`: For async functions in traits. +- `bytes`: For working with byte buffers. +- `http-body-util`: For working with HTTP bodies. +- `hyper`: For HTTP server and client implementation. +- `tokio`: For asynchronous runtime. +- `tracing`: For application-level tracing and logging. + +## Project Logic + +The project is structured to handle HTTP requests and process them using a wizard model. Here is a brief overview of the logic: + +1. **Initialization**: The `run` function initializes the `TargetRuntime` with HTTP, file system, and environment IO components. It then scrapes data from a specified URL and processes it into a query. + +2. **Wizard Interaction**: A `Wizard` instance is created using the processed query and an API key from the environment. The wizard is used to ask questions and get responses. + +3. **HTTP Server**: The `AppCtx` struct, which holds the `Wizard` instance and the scraped data, is passed to the HTTP server. The server listens for incoming requests. + +4. **Request Handling**: When a request is received, the `handle_request` function processes the request body, creates a `Question` instance, and uses the wizard to get a response. The response is then sent back to the client. + +This setup allows the project to dynamically process and respond to HTTP requests using the wizard model. diff --git a/src/margdarshak/helper_md/query.md b/src/margdarshak/helper_md/query.md index 2328831..72f8365 100644 --- a/src/margdarshak/helper_md/query.md +++ b/src/margdarshak/helper_md/query.md @@ -25,4 +25,4 @@ question: {{question}} Make sure to respond in json which contains content in markdown format format. -The response format must be {"response": "your response"}. \ No newline at end of file +The response format must be {"response": "your response"}.