Rasa Stroberi

Rasa Stroberi

Select which actions should receive domain#

You can control if an action should receive a domain or not.

To do this you must first enable selective domain in you endpoint configuration for action_endpoint in endpoints.yml.

url: "http://localhost:5055/webhook" # URL to your action server

enable_selective_domain: true

After selective domain for custom actions is enabled, domain will be sent only to those custom actions which have specifically stated that they need it. Custom actions inheriting from rasa-sdk FormValidationAction parent class are an exception to this rule as they will always have the domain sent to them. To specify if an action needs the domain add {send_domain: true} to custom action in the list of actions in domain.yml:

- action_hello_world: {send_domain: True} # will receive domain

- action_calculate_mass_of_sun # will not receive domain

- validate_my_form # will receive domain

Multiple Domain Files#

The domain can be defined as a single YAML file or split across multiple files in a directory. When split across multiple files, the domain contents will be read and automatically merged together. You can also manage your responses, slots, custom actions in Rasa Studio.

Using the command line interface, you can train a model with split domain files by running:

rasa train --domain path_to_domain_directory

Responses are templated messages that your assistant can send to your user. Responses can contain rich content like buttons, images, and custom json payloads. Every response is also an action, meaning that it can be used directly in an action step in a flow. Responses can be defined directly in the domain file under the responses key. For more information on responses and how to define them, see Responses.

Actions are the things your bot can do. For example, an action could:

All custom actions should be listed in your domain.

Rasa also has default actions which you do not need to list in your domain.

Slots are your assistant's memory. They act as a key-value store which can be used to store information the user provided (e.g. their home city) as well as information gathered about the outside world (e.g. the result of a database query).

Slots are defined in the slots section of your domain with their name, type and default value. Different slot types exist to restrict the possible values a slot can take.

If you decide to fill slots through response buttons where the payload syntax issues SetSlot command(s), note that the slot name must not include certain characters such as (, ), = or ,.

A text slot can take on any string value.

A boolean slot can only take on the values true or false. This is useful when you want to store a binary value.

A categorical slot can only take on values from a predefined set. This is useful when you want to restrict the possible values a slot can take.

If the user provides a value where the casing does not match the casing of the values defined in the domain, the value will be coerced to the correct casing. For example, if the user provides the value LOW for a slot with values low, medium, high, the value will be converted to low and stored in the slot.

If you define a categorical slot with a list of values, where multiple of the values coerce to the same value, a warning will be issued and you should remove one of the values from the set in the domain. For example, if you define a categorical slot with values low, medium, high, and Low, the value Low will be coerced to low and a warning will be issued.

A float slot can only take on floating point values. This is useful when you want to store a number with a decimal point.

This slot type can take on any value. This is useful when you want to store any type of information, including structured data like dictionaries.

A list slot can take on a list of values. Note that the list slot type is only supported in custom actions when building an assistant with CALM. List slots cannot be filled with flows in either the collect or set_slots flow step types.

When building an assistant with CALM, you can configure slot filling to either use nlu-based predefined slot mappings or the newly introduced from_llm slot mapping type.

You can continue using the nlu-based predefined slot mappings such as from_entity or from_intent when building an assistant with CALM. In addition to including tokenizers, featurizers, intent classifiers, and entity extractors to your pipeline, you must also add the NLUCommandAdapter to the config.yml file. The NLUCommandAdapter will match the output of the NLU pipeline (intents and entities) against the slot mappings defined in the domain file. If the slot mappings are satisfied, the NLUCommandAdapter will issue set slot commands to fill the slots.

If during message processing, the NLUCommandAdapter issues commands, then the following command generators in the pipeline such as LLM-based command generators will be entirely bypassed. As a consequence, LLM-based command generators will not be able to fill slots by issuing set slot commands at any point in the conversation flow. If the LLM-based command generator issues commands to fill slots with nlu-based predefined mappings, these set slot commands from LLM-based command generator are ignored. If no other commands were predicted for the same turn, then the assistant will trigger the cannot_handle conversation repair pattern.

Sometimes the user message may contain intentions that go beyond setting a slot. For example, the user message may contain an entity that fills a slot but also starts a digression that must be handled. In such cases, we recommend using NLU triggers to handle those specific intents within flows. Please refer to the Impact of slot mappings in different scenarios section for more details.

In a CALM assistant built with flows and using NLU components to process the message, the default action action_extract_slots will not run, because the slot set events are applied to the dialogue tracker during command execution. This ensures that this default action does not overwrite CALM set slot(./dialogue-understanding.mdx#set-slot) commands and does not duplicate SlotSet events that were already applied to the dialogue tracker.

In the case of coexistence, the action_extract_slots action will be executed only when the NLU-based system is active.

You can use the from_llm slot mapping type to fill slots with values generated by LLM-based command generators. This is the default slot mapping type if the mappings are not explicitly defined in the domain file.

In this example, the user_name slot will be filled with the value generated by the LLM-based command generator. The LLM-based command generator is allowed to fill this slot at any point in the conversation flow, not just at the corresponding collect step for this slot.

If you have defined additional NLU-based components in the config.yml pipeline, these components will continue to process the user message however they will not be able to fill slots. The NLUCommandAdapter will skip any slots with from_llm mappings and will not issue set slot commands to fill these slots. Please refer to the Impact of slot mappings in different scenarios section for more details.

Note that a slot must not have both from_llm and NLU-based predefined mappings or custom slot mappings. If you define a slot with from_llm mapping, you cannot define any other mapping types for that slot.

You can define conditions for slot mappings to be satisfied before the slot is filled. The conditions are defined as a list of conditions under the conditions key. Each condition can specify the flow id that must be active to the active_flow property.

This is particularly useful if you define several slots mapped to the same entity, but you do not want to fill all of them when the entity is extracted.

- active_flow: greet_user

- active_flow: issue_invoice

You can use the custom mapping type to define custom slot mappings for slots that should be filled by a custom action. The custom action must be specified in the action property of the slot mapping. You must also list the action in the domain file under the actions key.

- action_fill_user_name

action: action_fill_user_name

In this example, the user_name slot will be filled by the action_fill_user_name custom action. The custom action must return a SlotSet event with the slot name and value to fill the slot.

Note that if you're using the action_ask_ naming convention for requesting user input via a custom action, but the slot is filled by the value generated by the LLM-based command generator, you should not define a custom slot mapping for that slot. Instead, use from_llm mapping type, because custom mapping type is reserved for slots that are set by a custom action returning a SlotSet event (e.g. for slots set by external sources). You can continue using the action_ask_ convention to request user input for slots that are filled by the LLM-based command generator.

If you are using custom validation actions (using the validate_ naming convention) to validate slot values extracted by the LLM-based generator from the end user's input, you should not define custom slot mappings for those slots either. Instead, use the from_llm mapping type for those slots.

If you are training with the --skip-validation flag and you have defined slots with custom slot mappings that do not specify the action property in the domain file, nor do they have corresponding action_ask_ custom actions to request these slots, you will not receive errors at training time. However, at runtime, FlowPolicy will first cancel the user flow in progress and then trigger pattern_internal_error.

You can also run this check via the rasa data validate command.

This section clarifies which components in a CALM assistant built with flows and a NLU pipeline are responsible for filling slots in different scenarios when the flow is at either the collect step for slot name or at any other step.

Main takeaway is that the NLUCommandAdapter cannot fill slots with from_llm mappings at any point in the conversation.

You can provide an initial value for any slot in your domain file:

Session configuration#

A conversation session represents the dialogue between the assistant and the user. Conversation sessions can begin in three ways:

the user begins the conversation with the assistant,

the user sends their first message after a configurable period of inactivity, or

a manual session start is triggered with the /session_start intent message.

You can define the period of inactivity after which a new conversation session is triggered in the domain under the session_config key.

Available parameters are:

The default session configuration looks as follows:

session_expiration_time: 60 # value in minutes, 0 means infinitely long

carry_over_slots_to_new_session: true # set to false to forget slots between sessions

This means that if a user sends their first message after 60 minutes of inactivity, a new conversation session is triggered, and that any existing slots are carried over into the new session. Setting the value of session_expiration_time to 0 means that sessions will not end (note that the action_session_start action will still be triggered at the very beginning of conversations).

A session start triggers the default action action_session_start. Its default implementation moves all existing slots into the new session. Note that all conversations begin with an action_session_start. Overriding this action could for instance be used to initialize the tracker with slots from an external API call, or to start the conversation with a bot message. The docs on Customizing the session start action shows you how to do that.

Persistence of Slots during Coexistence#

In Coexistence of NLU-based and CALM systems the action action_reset_routing resets all slots and hides events from featurization for the NLU-based system policies to prevent them from seeing events that originated while CALM was active. However, you might want to share some slots that both CALM and the NLU-based system should be able to use. One use case for these slots are basic user profile slots. Both the NLU-based system and CALM should likely be able to know whether a user is logged in or not, what their user name is, or what channel they are using. If you are storing this kind of data in slots you can annotate those slot definitions with the option shared_for_coexistence: True.

shared_for_coexistence: True

shared_for_coexistence: True

In the coexistence mode, if the option shared_for_coexistence is NOT set to true, it invalidates the reset_after_flow_ends: False property in the flow definition. In order for the slot value to be retained throughout the conversation, the shared_for_coexistence must be set to true.

%PDF-1.7 %µµµµ 1 0 obj <>/Metadata 2069 0 R/ViewerPreferences 2070 0 R>> endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 17 0 R] /MediaBox[ 0 0 595.32 841.92] /Contents 4 0 R/Group<>/Tabs/S/StructParents 0>> endobj 4 0 obj <> stream xœ½]m�ÛHŽþ ÿA_gÒŠêE%é°X\2™ÙÍd&ÈmgvqØÛj[íVüº¶œÀÿþHÖ‹d«ªÛÓ–3Àt¤RIÅ"YäC²$¿~³mêûrÒDúÓë7MSNªiôÏןכ½þ|ØT¯?•³zU6õzõúv×`Ó_«rZmÿüçèí»£¿|‘Ä þ—ç‹’(-ÒXð(—,.x´­^¾øÇÑêå‹·Ÿ_¾xý3‹‹}¾ù{'ƒ®q‘Ë(+T,áÊúýå6‹f;xt4£³Üœýåå‹Ž¢ñ¿¢Ï¿¼|ñ<ñ^¾8›‚?Ò÷ijsgœ¨%" mïÇ7b´š®WÕ3‰ÌX§yhà]=¾Q£rÌØhÝ®'ãb-rTÁAƒ‡h ‡÷x½ÙlÆLŒxR�Õd~;çæŽO?OEœ°ýßO¨ü¡f,f}Ú~Yï·«r�¢��Áë{:|3–#d$;bä�kdí[–в_�…æ«‘ÂO«1KG³r†’Yj†ã3šáž«8KC“ú~�0<ÍâTöhûûø&­À¾ø¹d†‡fI'*4t†�å1�w…ùñ$΃óû8Î^ƒ«¢ˆsî5ºIH'×aošÄYP•®0S°cih8žðáÌà EhÄ+04Kcox† –ÄJ\m<~< Œ"¨-—y½Þ`2á1,ŠŽn†LÅ, öþ]Í-:®�³TŠô–ò<É/-oh®*×`5ør�yñûymùˆ×–2–jHÚ¢Ÿ~û1zFÞ®›f½Ç#?¯×Ísã‘Ô‡› ³4·ÂóÞ$åeÊìO$"fE`¼ï'piFà"‹Õ ¤=*ïóƒÏñ7CϤý²ÄÑ€TZG®añòÅ­7z}»)W8èo?¾%¯-W³`øÍï·ãáÔÈ.ÁbÞ_,¿ì·rW%D>DŸ* ÞfåÝÔo@%ΫM Ù´Ä“ßJ4á»–ô|À¼¼Bô 0§ÈBä_*û°d ¶Tö—2h.LBgõä$|„ñ+ÆR+©¢À˜þ”°O(ãjUmAì$ï Š›RO“,Éõôæý»!yÉY,Dˆä‹1…g<ç,4Þçj¾¦¬!§ÀfxPSlþv?3®O¦–yèCÑg\j†¡æâÒ^\E·²7Èû5žß‘êÁç'U‚xí<~ú-¯¥›9TY¤rŒsN"9x¶ŒB¹wõ4¦WRFVä1/¼4e´|@h;<(]Þæ“1iÊœDoôLj»} ã»ýfÌÝÞT«3檮$¡òX¤�¹š„ã¶UcP{§íû§©Î�÷©·P˜fñS}7óa4‡ûü�RE,ž×>ªŠ¨J#ˆ_Ô1] Ø:Pgð }f½ÇŽþ¶jêò[¹ºªXæ'Žœ#´cTÕ·CìÿÆØŸ¬°‘&ûj|ÃAðç÷˜ÑžâÔðÏÿЕt­ò ÛjÊz_�3B$ÏBœ¹,Ñã $¬bÌÚÉ®…e…,âD(ûG‰BÙŽ³Ñ”Pë\;ק©eƒ,&uª_"W(/þÕ¥Š3õyÙXI~6ž#ß!°�GÑ™Ìb%sLW=‘aô6ñA±ÈC„�­ÈGœþŠ¡�í�!•”˜\îtB†‹º©æ¨ñÚÑ!¨�Õ‰ª@l ”Fï)ÚƒF�åÒ”ìmÛöøçÕÌTùìrVÄR„¦|Žz�€|„å#ù a¿ Z_Ä2ÿoð€—Ù¨¤ó_QkíAÔèª^H¯´¨¨‹‘D&ìãcl͵ÃX±d"É:ù'£áœOM

%PDF-1.7 %µµµµ 1 0 obj <>/Metadata 133 0 R/ViewerPreferences 134 0 R>> endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/MediaBox[ 0 0 595.4 841.8] /Contents 4 0 R/Group<>/Tabs/S/StructParents 0>> endobj 4 0 obj <> stream xœÅ=ksÛ6¶ß3“ÿÀo+݉hâÁ×îÎÎu7í6íí��Ùé4ûA~»¶%×–Óuýâ 8x�€Ä„ Û™¨ âœ÷ ÷öï7WçË“Mö÷¿ïío6˓˳Óì—½×ëÍf}ûï½£§»³½Ÿ–W«åæj½Ú;|<ÞÀ¥oÖëÍÙý?þ‘½~û&ûíå‹"/࿦©iVde[æ

©2024 iStockphoto LP. Desain iStock adalah merek dagang iStockphoto LP.

Sebelum menanam Stroberi, ada baiknya kita mengenal terlebih dahulu karakteristik jenis-jenis buah subtropis yang satu ini. Pasalnya, masing-masing jenis memiliki metode pemeliharaan, kondisi lingkungan, dan hasil yang berbeda-beda. Ketepatan memilih varian Stroberi sesuai dengan kemampuan dan kondisi lingkungan kita akan memberikan hasil yang optimal dan sesuai harapan.

Stroberi sendiri termasuk ke keluarga Rosaceae dengan genus Fragaria. Nama Stroberi merupakan ejaan lokal yang diserap dari nama buah tersebut dalam Bahasa Inggris, yaitu Strawberry. Saat ini, buah yang kita konsumsi merupakan hasil hibrida dari persilangan antara antara Fragaria virginia L.var Duchesnes yang berasal dari Amerika Utara dan Fragaria chiloensis L.var Duchesnes yang berasal dari Chili. Hasil persilangan tahun 1750 tersebut kemudian menghasilkan persilangan-persilangan lebih lanjut yang menghasilkan Stroberi berukuran besar, harum, serta manis.

Dalam waktu tiga tahun terakhir ini, Divisi Pertanian Walungan sedang fokus membudidayakan satu varian Stroberi sambil terus menguji coba empat varian lainnya. Dari catatan riset Syarifuddin, Ketua Divisi Pertanian, berikut ini karakteristik kelima varian Stoberi yang sedang dikembangkan oleh Walungan di Pasir Angling, Suntenjaya, Lembang.

In Rasa, your domain defines the universe in which your assistant operates. Specifically, it lists:

If you are building an NLU-based assistant, refer to the Domain documentation to see how intents, entities, slot mappings, and slot featurization can be configured in your domain.

Anda mungkin ingin melihat