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

Test GPT Integration ("ask the docs") #48

Open
3 tasks
michaelweinold opened this issue Jan 11, 2023 · 7 comments
Open
3 tasks

Test GPT Integration ("ask the docs") #48

michaelweinold opened this issue Jan 11, 2023 · 7 comments

Comments

@michaelweinold
Copy link
Contributor

michaelweinold commented Jan 11, 2023

Potential Tools

@michaelweinold michaelweinold self-assigned this Jan 11, 2023
@michaelweinold michaelweinold changed the title Test GPT3 Integration ("ask the docs") Test GPT Integration ("ask the docs") Mar 26, 2023
@michaelweinold
Copy link
Contributor Author

michaelweinold commented Apr 2, 2023

ChatGPT (OpenAI) demo on cocalc.com (SageMath):

Screenshot 2023-04-02 at 18 27 36

@michaelweinold
Copy link
Contributor Author

michaelweinold commented Apr 9, 2023

"Could you train a ChatGPT-beating model for $85,000 and run it in a browser?" (cf. Hackernews discussion)

Related tools:

@michaelweinold
Copy link
Contributor Author

@michaelweinold
Copy link
Contributor Author

...no resources in the foreseeable future. Still, interesting to see what the Rocket Chat developers set up for their docs #48 (comment).

@michaelweinold
Copy link
Contributor Author

...recent movement in this area: Kagi Sidekick

@Haitham-ghaida
Copy link
Contributor

Hi @michaelweinold ,

Something that you can look at also is Flowise You can easily build a chatbot that reads the docs and uses that as a knowledge base. It works with openai and locally hosted models. You can have it in a docker container and it has an API endpoint to interact with the model, it even gives you a piece of html code you can add to the website, which will show a chat bubble.

I tested it with openai, it works ok, it would work better as the docs get better.

image

Here are some of the responses:
Me
how do i create a new project
AI
In Brightway, data is structured hierarchically with projects at the top level. Each project is self-contained, with its own copy of data, LCIA methods, calculations, assumptions, and any other data you need. Each project is completely independent of other projects. They are stored as subdirectories in the file system.
Although the precise command to create a new project is not stated in the given resources, typically in Brightway, you would use the projects function to manage your projects. For example, you can create a new project named "My new project" using the command projects.set_current("My new project"). This will create a new project with the given name if it does not exist, and switch to that project.
Me
how do i create an LCA
AI

Creating a Life Cycle Assessment (LCA) in Brightway typically involves creating an instance of the LCA class, which coordinates the assessment. The basic steps, as outlined in the documents provided, are as follows:

Translate the functional unit into a demand array.
Find the right parameter arrays and ask the matrix builder for matrices.
Solve the linear system Ax=B using a tool like SuperLU or UMFpack.
If a Life Cycle Impact Assessment (LCIA) method is present, multiply the result by the LCIA characterization factors.

In Python code, a basic example might look something like this:

from brightway2 import LCA

my_functional_unit = {my_activity: 1}  # replace 'my_activity' with your specific activity
my_method = my_impact_method  # replace 'my_impact_method' with your chosen impact assessment method

lca = LCA(my_functional_unit, my_method)

lca.lci()  # Perform the life cycle inventory analysis
lca.lcia()  # If you have an LCIA method, perform the life cycle impact assessment
lca.score # Gets the value

The example provided is a basic outline and might not work verbatim. Please refer to the official Brightway2 documentation or relevant support channels for the exact process and commands.

I also tested it with localai, but my computer doesn't have much resources to run a locally hosted model. To do that i just replaced the openai block in flowise with a localai block.

here is some of the tests.
Me
what is brightway?
AI
Brightway is an open source framework for Life Cycle Assessment (LCA) that was originally developed by Chris Mutel during his doctoral research project. It is a highly active software ecosystem maintained by developers and life-cycle practitioners from academia and industry.
Me
how do i see the exchanges of an activity
AI
The documents provided do not specifically detail how to view the exchanges of an activity. However, given that an activity in Brightway2 is a dictionary-like object and exchanges are stored in the 'exchanges' key, you can likely access them directly. If you have an activity object my_activity, you would use my_activity['exchanges'] to access its exchanges. Please consult the Brightway2 official documentation or appropriate support channels for the exact method to use.

Here is what the chat interface looks like
image

Overall, its not perfect, but i will run some more tests to see if i can improve the results

@michaelweinold
Copy link
Contributor Author

...recent movement in this area: Kagi Sidekick
#48 (comment)

...more recent developments at Kagi: Kagi Assistant

@michaelweinold michaelweinold closed this as not planned Won't fix, can't repro, duplicate, stale Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants