keventmesh / llm-tool-provider

Teach your LLM to dynamically call your services in Kubernetes
7 stars 3 forks source link

feat: add tool to get the current time #29

Closed Cali0707 closed 3 months ago

Cali0707 commented 3 months ago

This PR adds a new tool which is able to get the current time in UTC in RFC3339 format.

To add the tool, we:

  1. Created a function with func create -l go -t cloudevents and added code to handle setting the responseid, as well as returning the current time
  2. Subscribed the function to the current.time eventtype with func subscribe -f type=current.time -s chat-broker
  3. Created an EventType resource for the current.time events

After these changes, the LLM is able to reply to requests for the current time: image