Skip to content

llm-tools-functions demo issue in get_customer_orders() code #215

@jota-db

Description

@jota-db

The comment in the function implementation in 00-stylist-AI-function-tools-introduction says: "Returns a list of customer orders for the given customer ID (expect a UUID)", but the code actually tests: where email=current_user() and the function receives no UUID parameter.

%sql
CREATE OR REPLACE FUNCTION get_customer_orders ()
RETURNS TABLE(user_id STRING,
  id STRING,
  transaction_date STRING,
  item_count DOUBLE,
  amount DOUBLE,
  order_status STRING)
COMMENT 'Returns a list of customer orders for the given customer ID (expect a UUID)'
LANGUAGE SQL
    RETURN
    SELECT o.* from tools_orders o 
    inner join tools_customers c on c.id = o.user_id 
    where email=current_user() ORDER BY transaction_date desc;

SELECT * FROM get_customer_orders();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions