{"id":26480247,"url":"https://github.com/hellostealth/stealth-luis","last_synced_at":"2025-03-20T02:13:17.642Z","repository":{"id":53126937,"uuid":"232677316","full_name":"hellostealth/stealth-luis","owner":"hellostealth","description":"Microsoft LUIS (Language Understanding) Stealth Integration","archived":false,"fork":false,"pushed_at":"2023-01-24T12:19:56.000Z","size":47,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-09T17:50:00.776Z","etag":null,"topics":["bot","bots","chatbot","entity-extraction","intent-detection","luis","luis-ai","nlp","nlu","ruby","stealth"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hellostealth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-08T23:02:49.000Z","updated_at":"2022-11-06T19:18:34.000Z","dependencies_parsed_at":"2023-02-13T21:16:49.594Z","dependency_job_id":null,"html_url":"https://github.com/hellostealth/stealth-luis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellostealth%2Fstealth-luis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellostealth%2Fstealth-luis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellostealth%2Fstealth-luis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hellostealth%2Fstealth-luis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hellostealth","download_url":"https://codeload.github.com/hellostealth/stealth-luis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244536457,"owners_count":20468350,"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":["bot","bots","chatbot","entity-extraction","intent-detection","luis","luis-ai","nlp","nlu","ruby","stealth"],"created_at":"2025-03-20T02:13:17.015Z","updated_at":"2025-03-20T02:13:17.634Z","avatar_url":"https://github.com/hellostealth.png","language":"Ruby","readme":"# Stealth LUIS\n\nThis integration implements the [Microsoft LUIS](https://luis.ai) Language Understanding service. It utilizes the built-in NLP features part of Stealth 2.x. If you are still using Stealth 1.x, you will first need to upgrade to Stealth 2.x before you can use this integration.\n\n## Configuration\n\nFor instructions on how to configure your Azure account signup for LUIS, please reference their docs. You won't have to set this anywhere, but this gem does utilize the latest `v3` LUIS API version.\n\nOnce your account is setup, these are the configuration settings you will need to add to you `services.yml` file:\n\n```yaml\ndefault: \u0026default\n  nlp_integration: luis\n  luis:\n    endpoint: westus.api.cognitive.microsoft.com\n    app_id: 9434fbd8-420b-6d75-8a6f-b6c9a0ac5ec0\n    subscription_key: 1b69a4b9db669805b4fcba5f1f2f87bb\n    tz_offset: 0\n    intent_threshold: 0.2\n\nproduction:\n  \u003c\u003c: *default\ndevelopment:\n  \u003c\u003c: *default\ntest:\n  \u003c\u003c: *default\n```\n\nStealth will automatically use your `staging` LUIS slot in development and staging environments and will use the `production` slot for your production Stealth environment.\n\nThat's it! Stealth will now automatically use LUIS for intent detection and entity extraction automatically via `handle_message` and `get_match`.\n\n## Intents\n\nWe recommend you name your intents using snake case (`snake_case`). This is because this integration will automatically convert your intent names to Ruby symbols.\n\nSo for example, if you have a `handle_message` defined like this:\n\n```ruby\nhandle_message(\n  'Maybe' =\u003e proc { step_to state: :say_maybe },\n  :yes =\u003e proc { step_to state: :say_yes },\n  :no =\u003e proc { step_to state: :say_no }\n)\n```\n\nIf your user responds with a variation of the string `maybe`, then they will be taken to the state `say_maybe`.\n\nOtherwise, the intent named `yes` and the intent named `no` will attempt to be matched. So if you had named your intent `YES` for example, you'd have to use `:YES` here which doesn't match Ruby syntax conventions.\n\nFor more info about how intents are matched, please see the [Stealth NLP documentation](https://github.com/hellostealth/stealth/wiki/NLP).\n\n### intent_threshold\n\nThis is the real number that respresents the minimum threshold required for an intent to match. So if for example your `intent_threshold` is set to `0.2`, if the top intent scores `0.09`, it will not be returned as a match.\n\n## Entities\n\nThe entity types listed below are named using their corresponding Stealth type. The equivalent type used by Microsoft LUIS is also listed. For each code sample, the sample query is first provided followed by the array of entities extracted from the queries (for the given type).\n\nIt's possible, and even likely, that a query matches more than one entity type. For example, a `currency` type will also match a `number` type. For more info about how to utilize these types, please see the [Stealth NLP documentation](https://github.com/hellostealth/stealth/wiki/NLP).\n\n### number\n\nLUIS prebuilt entity: `number`\n\n```ruby\n\"I think it was something like 63 or maybe 764\"\n\n[\n  63,\n  764\n]\n```\n\n```ruby\n\"It was almost 15k\"\n\n[\n  15000\n]\n```\n\nFor more info about these values, please reference the [number entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-number?tabs=V3).\n\n### currency\n\nLUIS prebuilt entity: `money`\n\n```ruby\n\"send me $87 or 48 cents\"\n\n[\n  { 'number' =\u003e 87, 'units' =\u003e 'Dollar' },\n  { 'number' =\u003e 48, 'units': 'Cent' }\n]\n```\n\nFor more info about these values, please reference the [money entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-currency?tabs=V3).\n\n### email\n\nLUIS prebuilt entity: `email`\n\n```ruby\n\"you can contact me at john@email.none\"\n\n[\n  \"john@email.none\"\n]\n```\n\nFor more info about these values, please reference the [email entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-email?tabs=V3).\n\n### phone\n\nLUIS prebuilt entity: `phonenumber`\n\nNote: LUIS does not parse nor attempts to clean up phone number.\n\n```ruby\n\"You can reach me at 313-555-1212\"\n\n[\n  \"313-555-1212\"\n]\n```\n\nFor more info about these values, please reference the [phonenumber entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-phonenumber?tabs=V3).\n\n### percentage\n\nLUIS prebuilt entity: `percentage`\n\n```ruby\n\"The stock is up 8.9% today\"\n\n[\n  8.9\n]\n```\n\nFor more info about these values, please reference the [percentage entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-percentage?tabs=V3).\n\n### age\n\nLUIS prebuilt entity: `age`\n\n```ruby\n\"81 years old\"\n\n[\n  { 'number' =\u003e 81, 'units' =\u003e 'Year' }\n]\n```\n\nFor more info about these values, please reference the [age entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-age?tabs=V3).\n\n### url\n\nLUIS prebuilt entity: `url`\n\n```ruby\n\"please visit google.com or https://google.com\"\n\n[\n  \"google.com\",\n  \"https://google.com\"\n]\n\n```\n\nFor more info about these values, please reference the [url entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-url?tabs=V3).\n\n### ordinal\n\nLUIS prebuilt entity: `ordinalV2`\n\n```ruby\n\"they finished 2nd and 5th\"\n\n[\n  { 'offset' =\u003e 2, 'relativeTo' =\u003e 'start' },\n  { 'offset' =\u003e 5, 'relativeTo' =\u003e 'start' }\n]\n```\n\n```ruby\n\"she finished last\"\n\n[\n  { 'offset' =\u003e 0, 'relativeTo' =\u003e 'end' }\n]\n```\n\nFor more info about these values, please reference the [ordinalV2 entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-ordinal-v2?tabs=V3).\n\n### geo\n\nLUIS prebuilt entity: `geographyV2`\n\n```ruby\n\"She moved to paris, france\"\n\n[\n  { 'value' =\u003e 'paris', 'type' =\u003e 'city' },\n  { 'value' =\u003e 'france', 'type' =\u003e 'countryRegion' }\n]\n```\n\nFor more info about these values, please reference the [geographyV2 entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-geographyv2?tabs=V3).\n\n### dimension\n\nLUIS prebuilt entity: `dimension`\n\n```ruby\n\"it's about 4 inches wide\"\n\n[\n  { \"number\": 4, \"units\": \"Inch\" }\n]\n```\n\nFor more info about these values, please reference the [dimension entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-dimension?tabs=V3).\n\n### temp\n\nLUIS prebuilt entity: `temperature`\n\n```ruby\n\"it feels like 98 degrees\"\n\n[\n  { 'number' =\u003e 98, 'units' =\u003e 'Degree' }\n]\n```\n\nFor more info about these values, please reference the [temperature entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-temperature?tabs=V3).\n\n### datetime\n\nLUIS prebuilt entity: `datetimeV2`\n\nThis one is the most complicated one to work with. The values are nested pretty deeply. This integration exposes the values at such a high level because there is a chance that LUIS will return results for more than one date type. For example, below we have just one result of type `date`, but LUIS could return more than one object of subtype `daterange`, `time`, `timerange`, etc. See the docs for more info about these subtypes.\n\n```ruby\n\"How about Mar 12?\"\n\n[\n  {\n    \"type\": \"date\",\n    \"values\": [\n      {\n        \"timex\": \"XXXX-03-12\",\n        \"resolution\": [\n          {\n            \"value\": \"2019-03-12\"\n          },\n          {\n            \"value\": \"2020-03-12\"\n          }\n        ]\n      }\n    ]\n  }\n]\n```\n\nFor more info about these values, please reference the [datetimeV2 entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-datetimev2?tabs=1-1%2C2-1%2C3-1%2C4-1%2C5-1%2C6-1#types-of-datetimev2).\n\n### duration\n\nLUIS prebuilt domain entity: `Calendar.Duration`\n\n```ruby\n\"it will be between 15 minutes and 3 hours\"\n\n[\n  \"15 minutes\",\n  \"3 hours\"\n]\n```\n\n_Additional docs for this prebuilt domain entitiy is not available_\n\n### key_phrase\n\nLUIS prebuilt entity: `keyPhrase`\n\n```ruby\n\"I need to find the instructional materials for the course\"\n\n[\n  \"instructional materials\",\n  \"course\"\n]\n```\n\nFor more info about these values, please reference the [keyPhrase entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-keyphrase?tabs=V3).\n\n### name\n\nLUIS prebuilt entity: `personName`\n\n```ruby\n\"Little Cindy-Lou Who who was not more than two\"\n\n[\n  \"Little Cindy-Lou\"\n]\n```\n\nFor more info about these values, please reference the [personName entity LUIS documentation](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/luis-reference-prebuilt-person?tabs=V3).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellostealth%2Fstealth-luis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhellostealth%2Fstealth-luis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhellostealth%2Fstealth-luis/lists"}