Skip to content
This repository was archived by the owner on Aug 9, 2025. It is now read-only.

feat: tool calling - #35

Merged
bradyjoslin merged 1 commit into
mainfrom
tool-calling
Jun 17, 2024
Merged

bradyjoslin merged 1 commit into
mainfrom
tool-calling

Conversation

@bradyjoslin

@bradyjoslin bradyjoslin commented Jun 17, 2024 •

Copy link
Copy Markdown
Owner

Add support for function / tool calling with Anthropic and OpenAI.

Example:

name: Sentiment Analysis Workflow
description: |
  Uses the OpenAI tools / function calling capability that takes unstructured prompt text
  and returns structured data, in this case in the form of sentiment scores.

  Also compatible with the Anthropic plugin.

tasks:
  - name: print_sentiment_scores
    plugin: openai
    description: Prints the sentiment scores of a given text.
    tools: 
      - name: sentiment_scores
        description: provide sentiment scores based on input
        input_schema: 
          type: object
          properties: 
            positive_score: 
              type: number
              description: The positive sentiment score, ranging from 0.0 to 1.0.
            negative_score: 
              type: number
              description: The negative sentiment score, ranging from 0.0 to 1.0.
            neutral_score: 
              type: number
              description: The neutral sentiment score, ranging from 0.0 to 1.0.
          required: 
            - positive_score
            - negative_score
            - neutral_score
    prompt: |
      After a long week of hard work and challenges, it feels incredibly rewarding to see 
      our team's efforts pay off with such remarkable results. The support from our colleagues 
      was instrumental in overcoming the hurdles we faced. Although there were moments of doubt 
      and stress, the overall experience has been positive and fulfilling.

Output:

{
  "input": {
    "negative_score": 0.1,
    "neutral_score": 0.3,
    "positive_score": 0.6
  },
  "name": "sentiment_scores"
}

@bradyjoslin
bradyjoslin merged commit 90dd989 into main Jun 17, 2024
@bradyjoslin
bradyjoslin deleted the tool-calling branch June 17, 2024 04:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址