{"id":28970026,"url":"https://github.com/xulerxyz/wit_parser","last_synced_at":"2025-06-24T10:14:24.422Z","repository":{"id":287861123,"uuid":"966032260","full_name":"xulerxyz/wit_parser","owner":"xulerxyz","description":"Wit.ai Parser For Laravel","archived":false,"fork":false,"pushed_at":"2025-04-14T10:00:51.000Z","size":4912,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T21:02:25.795Z","etag":null,"topics":["laravel","php","wit","witai"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/nigel/wit_parser","language":"PHP","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/xulerxyz.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,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-14T09:48:26.000Z","updated_at":"2025-04-14T14:06:00.000Z","dependencies_parsed_at":"2025-04-14T10:42:12.849Z","dependency_job_id":"8439ae5f-4cff-4a3f-83d5-b7b555cd684a","html_url":"https://github.com/xulerxyz/wit_parser","commit_stats":null,"previous_names":["xulerxyz/wit_parser"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/xulerxyz/wit_parser","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xulerxyz%2Fwit_parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xulerxyz%2Fwit_parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xulerxyz%2Fwit_parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xulerxyz%2Fwit_parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xulerxyz","download_url":"https://codeload.github.com/xulerxyz/wit_parser/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xulerxyz%2Fwit_parser/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261649882,"owners_count":23189767,"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":["laravel","php","wit","witai"],"created_at":"2025-06-24T10:14:23.554Z","updated_at":"2025-06-24T10:14:24.410Z","avatar_url":"https://github.com/xulerxyz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wit.ai Parser for Laravel\n\nA Laravel package for interacting with Wit.ai's API, providing easy-to-use services for message parsing and entity/intent management.\n\n## Installation\n\n1. Install the package via Composer:\n```bash\ncomposer require nigel/wit_parser\n```\n\n2. Publish the configuration file:\n```bash\nphp artisan vendor:publish --provider=\"Nigel\\WitParser\\WitParserServiceProvider\" --tag=\"config\"\n```\n\n3. Add your Wit.ai credentials to your `.env` file:\n```\nWIT_AI_TOKEN=your_wit_ai_token_here\nWIT_AI_BASE_URL=https://api.wit.ai/\n```\n\n## Usage\n\n### Message Parsing\n\n```php\nuse Nigel\\WitParser\\WitParserService;\n\nclass YourController extends Controller\n{\n    public function parseMessage()\n    {\n        $parser = new WitParserService();\n        $result = $parser-\u003eparse(\"What's the weather in New York?\");\n        \n        // Access parsed data\n        $intent = $result-\u003eintent;        // e.g., \"get_weather\"\n        $confidence = $result-\u003econfidence; // e.g., 0.95\n        $entities = $result-\u003eentities;    // Array of entities\n        $raw = $result-\u003eraw;              // Raw API response\n    }\n}\n```\n\n### Managing Entities and Intents\n\n```php\nuse Nigel\\WitParser\\WitManagerService;\n\nclass YourController extends Controller\n{\n    public function manageWit()\n    {\n        $manager = new WitManagerService();\n        \n        // Create a new entity\n        $entity = $manager-\u003ecreateEntity('location', [\n            ['value' =\u003e 'New York'],\n            ['value' =\u003e 'London']\n        ]);\n        \n        // Get all entities\n        $entities = $manager-\u003egetEntities();\n        \n        // Create a new intent\n        $intent = $manager-\u003ecreateIntent('get_weather', [\n            ['text' =\u003e 'What\\'s the weather in New York?'],\n            ['text' =\u003e 'How\\'s the weather in London?']\n        ]);\n        \n        // Get all intents\n        $intents = $manager-\u003egetIntents();\n        \n        // Get app info\n        $appInfo = $manager-\u003egetAppInfo();\n    }\n}\n```\n\n## Available Methods\n\n### WitParserService\n- `parse(string $message): WitResult` - Parse a message and get structured data\n\n### WitManagerService\n- `createEntity(string $name, array $values = []): array` - Create a new entity\n- `getEntities(): array` - Get all entities\n- `createIntent(string $name, array $examples = []): array` - Create a new intent\n- `getIntents(): array` - Get all intents\n- `getAppInfo(): array` - Get app information\n\n## WitResult Object\n\nThe `parse()` method returns a `WitResult` object with the following properties:\n- `intent`: The detected intent\n- `confidence`: Confidence score (0-1)\n- `entities`: Array of detected entities\n- `raw`: Raw API response\n\n## Error Handling\n\nThe package throws `RuntimeException` with descriptive messages for:\n- API request failures\n- Invalid responses\n- Network errors\n- Authentication issues\n\n## License\n\nThis package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxulerxyz%2Fwit_parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxulerxyz%2Fwit_parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxulerxyz%2Fwit_parser/lists"}