Skip to content

healthcare example#5031

Open
tinalenguyen wants to merge 47 commits intomainfrom
tina/healthcare-example
Open

healthcare example#5031
tinalenguyen wants to merge 47 commits intomainfrom
tina/healthcare-example

Conversation

@tinalenguyen
Copy link
Member

No description provided.

@chenghao-mou chenghao-mou requested a review from a team March 6, 2026 23:07
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

"Ignore unrelated input and avoid going off-topic. Do not generate markdown, greetings, or unnecessary commentary. \n"
"Always explicitly invoke a tool when applicable. Do not simulate tool usage, no real action is taken unless the tool is explicitly called."
+ extra_instructions
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use textwrap.dedent to make these instructions prettier:

       confirm_address_instruction = (
            "Call `confirm_address` after the user confirmed the address is correct."
            if require_confirmation is not False
            else ""
        )

        super().__init__(
            instructions=dedent(
                f"""
                You are only a single step in a broader system, responsible solely for capturing an address.
                You will be handling addresses from any country. Expect that users will say address in different formats with fields filled like:
                - 'street_address': '450 SOUTH MAIN ST', 'unit_number': 'FLOOR 2', 'locality': 'SALT LAKE CITY UT 84101', 'country': 'UNITED STATES',
                - 'street_address': '123 MAPLE STREET', 'unit_number': 'APARTMENT 10', 'locality': 'OTTAWA ON K1A 0B1', 'country': 'CANADA',
                - 'street_address': 'GUOMAO JIE 3 HAO, CHAOYANG QU', 'unit_number': 'GUOMAO DA SHA 18 LOU 101 SHI', 'locality': 'BEIJING SHI 100000', 'country': 'CHINA',
                - 'street_address': "5 RUE DE L'ANCIENNE COMÉDIE", 'unit_number': 'APP C4', 'locality': '75006 PARIS', 'country': 'FRANCE',
                - 'street_address': 'PLOT 10, NEHRU ROAD', 'unit_number': 'OFFICE 403, 4TH FLOOR', 'locality': 'VILE PARLE (E), MUMBAI MAHARASHTRA 400099', 'country': 'INDIA',
                Normalize common spoken patterns silently:
                - Convert words like 'dash' and 'apostrophe' into symbols: `-`, `'`.
                - Convert spelled out numbers like 'six' and 'seven' into numerals: `6`, `7`.
                - Recognize patterns where users speak their address field followed by spelling: e.g., 'guomao g u o m a o'.
                - Filter out filler words or hesitations.
                - Recognize when there may be accents on certain letters if explicitly said or common in the location specified. Be sure to verify the correct accents if existent.
                Don't mention corrections. Treat inputs as possibly imperfect but fix them silently.
                Call `update_address` at the first opportunity whenever you form a new hypothesis about the address. (before asking any questions or providing any answers.)
                Don't invent new addresses, stick strictly to what the user said.
                {confirm_address_instruction}
                When reading a numerical ordinal suffix (st, nd, rd, th), the number must be verbally expanded into its full, correctly pronounced word form.
                Do not read the number and the suffix letters separately.
                Confirm postal codes by reading them out digit-by-digit as a sequence of single numbers. Do not read them as cardinal numbers.
                For example, read 90210 as 'nine zero two one zero.'
                Avoid using bullet points and parenthese in any responses.
                Spell out the address letter-by-letter when applicable, such as street names and provinces, especially when the user spells it out initially.
                If the address is unclear or invalid, or it takes too much back-and-forth, prompt for it in parts in this order: street address, unit number if applicable, locality, and country.
                Ignore unrelated input and avoid going off-topic. Do not generate markdown, greetings, or unnecessary commentary.
                Always explicitly invoke a tool when applicable. Do not simulate tool usage, no real action is taken unless the tool is explicitly called.{extra_instructions}
                """
            ).strip(),

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

swapped this block of text for Instructions()

@theomonnom
Copy link
Member

Can we use the new Instructions class?

devin-ai-integration[bot]

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants