For AI agents: a documentation index is available at /docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path or by requesting the page with an `Accept: text/markdown` request header, e.g. `curl -H "Accept: text/markdown" https://edb-docs-staging.netlify.app/docs/epas/latest/`. Prefer markdown over HTML for short, accurate content.
@defineclassUrlArtifact(BaseArtifact):"""Stores a url.
Attributes:
value: The url.
"""
value:str= field(metadata={"serializable":True})defto_bytes(self,*, headers:dict|None=None,**kwargs:dict)->bytes:"""Fetches the content of the URL and returns it as bytes.
Args:
headers: Optional headers to include in the request.
**kwargs: Additional keyword arguments, not used.
Returns:
bytes: The content of the URL as bytes.
"""
response = requests.get(self.value, headers=headers)
response.raise_for_status()return response.content
defto_text(self)->str:"""Returns the URL as is."""return self.value
value = field(metadata={'serializable': True}) class-attribute instance-attribute
to_bytes(*, headers=None, **kwargs)
Fetches the content of the URL and returns it as bytes.
Parameters
Name
Type
Description
Default
headers
dict | None
Optional headers to include in the request.
None
**kwargs
dict
Additional keyword arguments, not used.
{}
Returns
Name
Type
Description
bytes
bytes
The content of the URL as bytes.
Source Code in griptape/artifacts/url_artifact.py
defto_bytes(self,*, headers:dict|None=None,**kwargs:dict)->bytes:"""Fetches the content of the URL and returns it as bytes.
Args:
headers: Optional headers to include in the request.
**kwargs: Additional keyword arguments, not used.
Returns:
bytes: The content of the URL as bytes.
"""
response = requests.get(self.value, headers=headers)
response.raise_for_status()return response.content
to_text()
Source Code in griptape/artifacts/url_artifact.py
defto_text(self)->str:"""Returns the URL as is."""return self.value