Comments (11)
Sure thing!
It eventually worked (woot!), but I did receive a few errors.. here's the output:
[04/17/23 08:10:59] INFO Step d384832c6a8649989d387ae4745053cb
Input: Give me a summary of https://en.wikipedia.org/wiki/Large_language_model
[04/17/23 08:11:03] INFO Substep d2efa62c2952422da831b13b06249be3
Thought: I can use the WebScraper tool to generate a summary of the web page.
Action: {"tool": "WebScraper", "action": "summarize_page", "value":
"https://en.wikipedia.org/wiki/Large_language_model"}
[04/17/23 08:11:34] INFO Substep d2efa62c2952422da831b13b06249be3
Observation: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Jason\AppData\Local\Programs\Python\Python311\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u03a3' in position 177:
character maps to <undefined>
[04/17/23 08:11:36] INFO Substep d3cf81ccc9ae4ce5a01326efa3ccf8cb
Action: {"tool": "WebScraper", "action": "summarize_page", "value":
"https://en.wikipedia.org/wiki/Large_language_model"}
[04/17/23 08:12:08] INFO Substep d3cf81ccc9ae4ce5a01326efa3ccf8cb
Observation: Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Jason\AppData\Local\Programs\Python\Python311\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode character '\u03a3' in position 177:
character maps to <undefined>
[04/17/23 08:12:12] INFO Step d384832c6a8649989d387ae4745053cb
Output: Large language models are neural networks with a large number of parameters used to
model natural language. They have been used to achieve state-of-the-art results in various
natural language processing tasks, such as language modeling, machine translation, and text
summarization. However, training these models requires massive amounts of data and computing
resources, and there are concerns about their potential to perpetuate biases and generate
harmful content.
INFO Step 8f6e91e1c5054ad680a96910f08874e0
Input: Say the following like a pirate: Large language models are neural networks with a
large number of parameters used to model natural language. They have been used to achieve
state-of-the-art results in various natural language processing tasks, such as language
modeling, machine translation, and text summarization. However, training these models
requires massive amounts of data and computing resources, and there are concerns about their
potential to perpetuate biases and generate harmful content.
[04/17/23 08:12:16] INFO Step 8f6e91e1c5054ad680a96910f08874e0
Output: Arrr, matey! Large language models be neural networks with a grand number o'
parameters used to model natural language. They've been used to achieve state-of-the-art
results in various natural language processing tasks, like language modeling, machine
translation, and text summarization. But, ye need a vast amount o' data and computing
resources to train these models, and there be worries about their potential to perpetuate
biases and generate harmful content.f
from griptape-docs.
Do you have access to GPT-4 on OpenAI? If not, Skatepark will return an error. We should update the docs to make this more explicit and, perhaps, not use GPT-4 in the quick start example :)
As for the other error, do you have the environment variable with the API key set correctly? Can you test printing it out outside of Skatepark?
Finally, could you confirm that you are on the latest version for all packages?
pip install -U skatepark-lib
pip install -U griptape-core
pip install -U griptape-tools
from griptape-docs.
Hi Vasily,
Thanks for the response. I double-checked, and you're right. I don't have access to gpt-4 yet on openAI. I'm on the waiting list - thought I had it, but not quite yet. :)
It probably is a good idea to not use it in the quick start example - since it's still not possible for everyone to have access.
I do have the environment variable & API set correctly. I've been able to confirm by using the API elsewhere, and I've also got all the packages updated as expected.
Is the code working correctly for you as expected?
For fun, I tried changing the pipeline.run command to:
pipeline.run("Give me a sentence for each of the following word: 'happy'")
and it had this thought:
Thought: I can use the WebScraper tool to search for sentences containing the word 'happy'
Action: {"tool": "WebScraper", "action": "search_page", "value": {"url":
"https://www.wordsinasentence.com/happy-in-a-sentence/", "query": "happy in a sentence"}}
which was cool, but then it returned these errors:
Observation: Traceback (most recent call last):
File "<string>", line 1, in <module>
File
"C:\Users\Jason\AppData\Local\Programs\Python\Python311\Lib\site-packages\griptape\core\decor ators.py", line 11, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"C:\Users\Jason\AppData\Local\Programs\Python\Python311\Lib\site-packages\griptape\tools\web_ scraper\tool.py", line 61, in search_page
params = json.loads(value.decode())
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jason\AppData\Local\Programs\Python\Python311\Lib\json\__init__.py", line
346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jason\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line
337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jason\AppData\Local\Programs\Python\Python311\Lib\json\decoder.py", line
353, in raw_decode
obj, end = self.scan_once(s, idx)
^^^^^^^^^^^^^^^^^^^^^^
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1
column 2 (char 1)
So it looks like there might be an error in the WebScraper tool?
cheers,
Jason
from griptape-docs.
Looks like something that was just fixed in the email tool (choking on single quotes in json).
from griptape-docs.
@shhlife, there was indeed a bug in WebScraper.search_page
. I just pushed a fixโlet me know if it works for you:
pip install -U griptape-tools
from griptape-docs.
Cool - it worked when I used the prompt: pipeline.run("Give me a sentence for the word happy")
but the example from the quickstart of summarizing https://en.wikipedia.org/wiki/Large_language_model still gave the error :
Step df287542794b4f93a0ccb7b3cd9fea9b
Invalid JSON: {'value': 'https://en.wikipedia.org/wiki/Large_language_model'} is not of type
'string'
from griptape-docs.
@shhlife, after your initial bug report, I found inconsistencies in how gpt-3.5 and gpt-4 interpret tool action schemas. Didn't catch that before since we only tested everything with gpt-4. Just finished rolling out updates for all three packages that should address that issue.
Could you try updating and running it again?
from griptape-docs.
How are you running this? Is it directly on Windows or via WSL?
from griptape-docs.
I'm running it in the terminal in Visual Studio Code on Windows
from griptape-docs.
Do you have Docker running on your box? If so, then you could try running tools in the DockerExecutor
:
from griptape.core.executors import DockerExecutor
tool_loader=ToolLoader(
tools=[calculator, scraper, email_client],
executor=DockerExecutor()
)
As soon as I get on a Windows box, I will try to debug this issue more.
from griptape-docs.
I don't have Docker running - but can try giving that a shot later. In the meantime, at least it's working eventually! :) Thanks for the help!
from griptape-docs.
Related Issues (20)
- Add missing task documentation
- Add documentation explaining `PromptStack`
- Add docs for extraction engines
- Docs For Streaming
- Add Documentation for GoogleDriveClient
- Add Documentation for GoogleDocsClient
- Update documentation for user versions of GoogleCalenderClient and GoogleGmailClient
- Update EmailClient documentation with example output
- Update GoogleGmailClient documentation with attachment
- Spelling error on front page HOT 3
- Feature Request: Add streaming to Chat utility HOT 1
- memory documentation contains references to griptape.memory.tool.storage
- Add namespace to Text Query Task docs
- Add documentation to handle dependencies for custom tools
- Add documentation for ImageGenerationTask HOT 1
- Code snippet for Custom Tools isn't rendering correctly
- Docs issue: Bedrock Titan Image Generation Driver Uses Wrong Model HOT 1
- Remove references to `create_index()` in `VectorStoreDriver` docs
- Integration Tests Should Only Run on Changed Files HOT 2
- Document how to use CodeExecutionTask in workflow HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from griptape-docs.