Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output Schema #922

Merged
merged 15 commits into from
Mar 30, 2024
Merged

Output Schema #922

merged 15 commits into from
Mar 30, 2024

Conversation

elisalimli
Copy link
Collaborator

@elisalimli elisalimli commented Mar 28, 2024

Summary

Fixes #918

Depends on

#925

Test plan

Here's an example SAML that I tested to scrape structured data from Amazon.com

workflows:
  - superagent:
      llm: gpt-3.5-turbo-1106
      name: Browser assistant
      intro: 👋 Hi there! How can I help search for answers on the internet.
      tools:
        - scraper:
            name: browser
            use_for: searching the internet
            metadata:
              apiKey: 9EA0OH7T2LXAXHPV3K036MN192XQZ2DRMP2XA9QC0KF2LBU9XCMXK8CJREIU5AVNOYPMHJD4Y2AEF8NR
      prompt: Use the browser to answer any questions
      output_schema:
        type: array
        items:
          type: object
          required:
            - id
            - name
          properties:
            id:
              type: integer
            product_name:
              type: integer
            product_price:
              type: string
  "input": "i need product name, product price, store name from https://www.amazon.com/s?k=apple+m3&crid=2CSLNASAYI715&sprefix=apple+mc%2Caps%2C376&ref=nb_sb_noss_2",

@elisalimli elisalimli self-assigned this Mar 28, 2024
Copy link

render bot commented Mar 28, 2024

@elisalimli elisalimli requested a review from homanp March 28, 2024 20:27
Copy link

vercel bot commented Mar 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
superagent-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 30, 2024 5:57pm

Copy link
Collaborator

@homanp homanp left a comment

Choose a reason for hiding this comment

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

Left a comment @elisalimli

Copy link
Collaborator

@homanp homanp left a comment

Choose a reason for hiding this comment

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

@elisalimli this needs work with the REST API and SDKs as well. could you add that as well? On the workflow invoke function.

@elisalimli
Copy link
Collaborator Author

@elisalimli this needs work with the REST API and SDKs as well. could you add that as well? On the workflow invoke function.

@homanp it will work on the SDK too. We just call our existing api_endpoints in SAML. So whatever works there will work on REST API/SDK

@elisalimli elisalimli requested a review from homanp March 29, 2024 05:47
@homanp
Copy link
Collaborator

homanp commented Mar 29, 2024

@elisalimli this needs work with the REST API and SDKs as well. could you add that as well? On the workflow invoke function.

@homanp it will work on the SDK too. We just call our existing api_endpoints in SAML. So whatever works there will work on REST API/SDK

I don't see any outputSchema key work invoking workflows in the REST API.

@elisalimli
Copy link
Collaborator Author

@elisalimli this needs work with the REST API and SDKs as well. could you add that as well? On the workflow invoke function.

@homanp it will work on the SDK too. We just call our existing api_endpoints in SAML. So whatever works there will work on REST API/SDK

I don't see any outputSchema key work invoking workflows in the REST API.

Yes, we don't. I thought it's redundant to receive outputSchema every time. Instead we're storing in the database and read from there.

@@ -175,6 +186,7 @@ async def _set_database_provider(self, datasource: dict):
f"Database provider is not set, using default provider - {database}"
)

print(database, database_provider)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove

Copy link
Collaborator

@homanp homanp left a comment

Choose a reason for hiding this comment

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

Screenshot 2024-03-29 at 11 38 52

@elisalimli elisalimli marked this pull request as draft March 29, 2024 19:41
@elisalimli elisalimli marked this pull request as ready for review March 30, 2024 07:15
@elisalimli elisalimli requested a review from homanp March 30, 2024 07:16
@elisalimli elisalimli merged commit 4def88b into main Mar 30, 2024
8 checks passed
@elisalimli elisalimli deleted the saml/output-schema branch March 30, 2024 19:24
@elisalimli elisalimli mentioned this pull request Apr 3, 2024
5 tasks
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.

Add output_schema to SAML.
2 participants