{"id":13314793,"url":"https://github.com/Ruan625Br/AIResponseMatcher","last_synced_at":"2025-03-10T21:30:42.256Z","repository":{"id":221918380,"uuid":"755758963","full_name":"Ruan625Br/AIResponseMatcher","owner":"Ruan625Br","description":"A library that analyzes the output of an AI an performs corresponding operations based on that analysis.","archived":false,"fork":false,"pushed_at":"2024-02-16T16:13:42.000Z","size":587,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-07-29T19:08:32.506Z","etag":null,"topics":["android-library","compose-multiplatform","cross-platform","kotlin-android","kotlin-multiplatform","library"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ruan625Br.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-11T00:32:39.000Z","updated_at":"2024-02-13T16:03:06.000Z","dependencies_parsed_at":"2024-02-13T19:52:42.319Z","dependency_job_id":null,"html_url":"https://github.com/Ruan625Br/AIResponseMatcher","commit_stats":null,"previous_names":["ruan625br/airesponsematcher"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ruan625Br%2FAIResponseMatcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ruan625Br%2FAIResponseMatcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ruan625Br%2FAIResponseMatcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ruan625Br%2FAIResponseMatcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ruan625Br","download_url":"https://codeload.github.com/Ruan625Br/AIResponseMatcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242930015,"owners_count":20208389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-library","compose-multiplatform","cross-platform","kotlin-android","kotlin-multiplatform","library"],"created_at":"2024-07-29T18:12:08.797Z","updated_at":"2025-03-10T21:30:42.247Z","avatar_url":"https://github.com/Ruan625Br.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"## AIResponseMatcher\n\nThis library analyzes the output of AI and calls corresponding operations in a simple and straightforward manner. Designed for ease of use, AIResponseMatcher simplifies the interpretation of AI responses, enabling efficient integration with specific operations.\n\n---\n\u003e [!WARNING]  \n\u003e This project is currently experimental and mostly just a proof-of-concept at this point. There are no tests and some things might be broken or very non-performant.\n\u003e The API may also change between releases without deprecation cycles.\n---\n\n## Consult the [documentation](https://ruan625br.github.io/AIResponseMatcher/)\n\n## Usage\n\n### Step 1. [Add the JitPack repository to the build file](https://jitpack.io/)\n\n### Step 2. Add the dependency\n\n#### Gradle: \n\n```java\nimplementation 'com.github.Ruan625Br:AIResponseMatcher:1.0.0-beta'\n```\n#### Gradle Kotlin DSL: \n\n```kotlin\nimplementation \"com.github.Ruan625Br:AIResponseMatcher:1.0.0-beta\"\n```\n\n#### Gradle version catlogs:\n\n```kotlin\nai-reponse-matcher = \"1.0.0-beta\"\n```\n\n```kotlin\nai-reponse-matcher = { group = \"com.github.Ruan625Br\", name = \"AIResponseMatcher\", version.ref = \"ai-reponse-matcher\" }\n```\n\n#### Maven:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.Ruan625Br\u003c/groupId\u003e\n  \u003cartifactId\u003eAIResponseMatcher\u003c/artifactId\u003e\n  \u003cversion\u003e1.0.0-beta\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### Step 3: Configure Your Arguments\n\nDefine the arguments that your operations will use by creating an enum class. In this example, `MyArgs` represents the possible arguments for operations, such as the file path and file name.\n\n```kotlin\nenum class MyArgs(val arg: String) : OperationArg {\n    PATH(\"path\"),\n    FILE_NAME(\"fileName\");\n\n    override val value: String\n        get() = arg\n}\n```\n\n### Step 4: Configure Your Operations\n\nCreate operations that will be performed based on the AI output. In this instance, the `FileOperations` object contains a `RenameFile` operation, which demonstrates how to handle renaming a file.\n\n```kotlin\nobject FileOperations {\n\n    data class RenameFile : Operation {\n        override fun resolve(output: String, args: Map\u003cString, String\u003e?): String {\n            val path = args?.get(MyArgs.PATH)\n            val fileName = args?.get(MyArgs.FILE_NAME)\n            val newValue = \"Starting process to rename the file to: $fileName\\nPath: $path\"\n\n            return output.replaceOperationWithNewValue(this, newValue)\n        }\n\n        override val name: String\n            get() = \"renameFile\"\n    }\n}\n```\n\n### Step 5: Configure AI Output\n\nCombine your AI output with the defined operations to create an `Output` instance. Here, the `operations` list includes the `RenameFile` and `CreateFile` operations.\n\n```kotlin\nval operations = listOf(FileOperations.RenameFile, FileOperations.CreateFile)\nval output = Output(outputAI, operations)\n```\n\n### Step 6: Process Lines\n\nExecute the operations on the AI output to process lines accordingly. In this step, the `processLines()` method is invoked on the `output` instance.\n\n```kotlin\nval result = output.processLines()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRuan625Br%2FAIResponseMatcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRuan625Br%2FAIResponseMatcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRuan625Br%2FAIResponseMatcher/lists"}