Skip to content

Add Recipe Generator sample application to examples #84

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

Merged
merged 2 commits into from
Feb 29, 2024

Conversation

techmaharaj
Copy link
Contributor

Adding a new recipe generator sample application that uses gptscript and gptscript vision to analyze an image, extract ingredients from it, and suggest a recipe based on it.

@cjellick
Copy link
Contributor

I'm getting the following error when trying to run. I have followed the instructions with the small adjustment of using a python virtualenv

$ flask run
Traceback (most recent call last):
  File "/Users/cjellick/projects/gptscript/examples/recipegenerator/env/bin/flask", line 5, in <module>
    from flask.cli import main
  File "/Users/cjellick/projects/gptscript/examples/recipegenerator/env/lib/python3.11/site-packages/flask/__init__.py", line 7, in <module>
    from .app import Flask as Flask
  File "/Users/cjellick/projects/gptscript/examples/recipegenerator/env/lib/python3.11/site-packages/flask/app.py", line 28, in <module>
    from . import cli
  File "/Users/cjellick/projects/gptscript/examples/recipegenerator/env/lib/python3.11/site-packages/flask/cli.py", line 18, in <module>
    from .helpers import get_debug_flag
  File "/Users/cjellick/projects/gptscript/examples/recipegenerator/env/lib/python3.11/site-packages/flask/helpers.py", line 16, in <module>
    from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/Users/cjellick/projects/gptscript/examples/recipegenerator/env/lib/python3.11/site-packages/werkzeug/urls.py)
(env) recipegenerator $ python app.py
Traceback (most recent call last):
  File "/Users/cjellick/projects/gptscript/examples/recipegenerator/app.py", line 1, in <module>
    from flask import Flask, request, render_template, jsonify
  File "/Users/cjellick/projects/gptscript/examples/recipegenerator/env/lib/python3.11/site-packages/flask/__init__.py", line 7, in <module>
    from .app import Flask as Flask
  File "/Users/cjellick/projects/gptscript/examples/recipegenerator/env/lib/python3.11/site-packages/flask/app.py", line 28, in <module>
    from . import cli
  File "/Users/cjellick/projects/gptscript/examples/recipegenerator/env/lib/python3.11/site-packages/flask/cli.py", line 18, in <module>
    from .helpers import get_debug_flag
  File "/Users/cjellick/projects/gptscript/examples/recipegenerator/env/lib/python3.11/site-packages/flask/helpers.py", line 16, in <module>
    from werkzeug.urls import url_quote
ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/Users/cjellick/projects/gptscript/examples/recipegenerator/env/lib/python3.11/site-packages/werkzeug/urls.py)

You know what's wrong @techmaharaj ?

@cjellick
Copy link
Contributor

Going to talk through this with @ibuildthecloud. This is the first example that includes "normal" source code that needs installed/launched. All other examples are simple gptscript files. I just want to see if he wants to organize these "more complex" examples differently. I'll get back to you when we hash that out today.

Copy link

@hiramgabriel1 hiramgabriel1 left a comment

Choose a reason for hiding this comment

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

dont use "var" to declare variables

@cjellick
Copy link
Contributor

Going to talk through this with @ibuildthecloud. This is the first example that includes "normal" source code that needs installed/launched. All other examples are simple gptscript files. I just want to see if he wants to organize these "more complex" examples differently. I'll get back to you when we hash that out today.

He's good with it living right where it is - a subdir of examples


2. Navigate to the `examples/recipegenerator` directory and install the dependencies:

Python:
Copy link
Contributor

Choose a reason for hiding this comment

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

should we include creating a virtualenv? or is that not necessary?

Copy link
Contributor

Choose a reason for hiding this comment

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

meh. let ppl decide that for themselves

@cloudnautique cloudnautique merged commit 954fa75 into gptscript-ai:main Feb 29, 2024
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.

4 participants