Skip to content

change DALL-E test prompts #1985

change DALL-E test prompts

change DALL-E test prompts #1985

GitHub Actions / Staging Test Results failed Nov 7, 2023 in 0s

343 tests run, 341 passed, 1 skipped, 1 failed.

Annotations

Check failure on line 26 in tests/steamship_tests/agents/tools/test_multiple_choice_tool.py

See this annotation in the file changed.

@github-actions github-actions / Staging Test Results

test_multiple_choice_tool.test_multiple_choice_tool[America-Countries,USA]

steamship.base.error.SteamshipError: [ERROR - POST /streamResultToBlocks] Unable to upload data to the cloud storage service Wrapped Message: Could not upload key spaces/ED6EAF22-58F9-4AAC-8936-23491E65F5EF/242873FD-812F-44A7-9CD5-C46A10172F0A/imports/B50E7896-9EFD-4464-85B0-E163599D87A4 to S3 bucket steamship-spaces-staging to S3
Raw output
client = Steamship(config=Configuration(api_key=SecretStr('**********'), api_base=AnyHttpUrl('https://api.staging.steamship.com...kspace_id='242873FD-812F-44A7-9CD5-C46A10172F0A', workspace_handle='test_brc2jv8gie', profile='test', request_id=None))
x = 'America', gold = 'Countries,USA'

    @pytest.mark.parametrize(("x", "gold"), TESTS)
    @pytest.mark.usefixtures("client")
    def test_multiple_choice_tool(client: Steamship, x, gold):
        """Tests that we can inspect the package and mixin routes"""
        tool = MultipleChoiceTool()
        context = with_llm(
            OpenAI(client=client),
            AgentContext.get_or_create(client=client, context_keys={"id": "test"}),
        )
    
>       res = tool.run([Block(text=x)], context)

tests/steamship_tests/agents/tools/test_multiple_choice_tool.py:26: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/steamship/agents/tools/classification/multiple_choice_tool.py:126: in run
    answer = llm.complete(prompt)
src/steamship/agents/llms/openai.py:63: in complete
    action_task.wait()
src/steamship/base/tasks.py:268: in wait
    self.refresh()
src/steamship/base/tasks.py:313: in refresh
    resp = self.client.post("task/status", payload=req, expect=self.expect)
src/steamship/base/client.py:579: in post
    return self.call(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = Steamship(config=Configuration(api_key=SecretStr('**********'), api_base=AnyHttpUrl('https://api.staging.steamship.com...kspace_id='242873FD-812F-44A7-9CD5-C46A10172F0A', workspace_handle='test_brc2jv8gie', profile='test', request_id=None))
verb = <Verb.POST: 'POST'>, operation = 'task/status'
payload = TaskStatusRequest(task_id='74979B71-7939-4085-9464-A5FFADA99CF4')
file = None
expect = <class 'steamship.data.operations.generator.GenerateResponse'>
debug = False, raw_response = False, is_package_call = False
package_owner = None, package_id = None, package_instance_id = None
as_background_task = False, wait_on_tasks = None, timeout_s = None
task_delay_ms = None

    def call(  # noqa: C901
        self,
        verb: Verb,
        operation: str,
        payload: Union[Request, dict, bytes] = None,
        file: Any = None,
        expect: Type[T] = None,
        debug: bool = False,
        raw_response: bool = False,
        is_package_call: bool = False,
        package_owner: str = None,
        package_id: str = None,
        package_instance_id: str = None,
        as_background_task: bool = False,
        wait_on_tasks: List[Union[str, Task]] = None,
        timeout_s: Optional[float] = None,
        task_delay_ms: Optional[int] = None,
    ) -> Union[
        Any, Task
    ]:  # TODO (enias): I would like to list all possible return types using interfaces instead of Any
        """Post to the Steamship API.
    
        All responses have the format::
    
        .. code-block:: json
    
           {
               "data": "<actual response>",
               "error": {"reason": "<message>"}
           } # noqa: RST203
    
        For the Python client we return the contents of the `data` field if present, and we raise an exception
        if the `error` field is filled in.
        """
        # TODO (enias): Review this codebase
        url = self._url(
            is_package_call=is_package_call,
            package_owner=package_owner,
            operation=operation,
        )
    
        headers = self._headers(
            is_package_call=is_package_call,
            package_owner=package_owner,
            package_id=package_id,
            package_instance_id=package_instance_id,
            as_background_task=as_background_task,
            wait_on_tasks=wait_on_tasks,
            task_delay_ms=task_delay_ms,
        )
    
        data = self._prepare_data(payload=payload)
    
        logging.debug(
            f"Making {verb} to {url} in workspace {self.config.workspace_handle}/{self.config.workspace_id}"
        )
        if verb == Verb.POST:
            if file is not None:
                files = self._prepare_multipart_data(data, file)
                resp = self._session.post(url, files=files, headers=headers, timeout=timeout_s)
            else:
                if isinstance(data, bytes):
                    resp = self._session.post(url, data=data, headers=headers, timeout=timeout_s)
                else:
                    resp = self._session.post(url, json=data, headers=headers, timeout=timeout_s)
        elif verb == Verb.GET:
            resp = self._session.get(url, params=data, headers=headers, timeout=timeout_s)
        else:
            raise Exception(f"Unsupported verb: {verb}")
    
        logging.debug(f"From {verb} to {url} got HTTP {resp.status_code}")
    
        if debug is True:
            logging.debug(f"Got response {resp}")
    
        response_data = self._response_data(resp, raw_response=raw_response)
    
        logging.debug(f"Response JSON {response_data}")
    
        task = None
        error = None
    
        if isinstance(response_data, dict):
            if "status" in response_data:
                try:
                    task = Task.parse_obj(
                        {**response_data["status"], "client": self, "expect": expect}
                    )
                    if "state" in response_data["status"]:
                        if response_data["status"]["state"] == "failed":
                            error = SteamshipError.from_dict(response_data["status"])
                            logging.warning(f"Client received error from server: {error}")
                except TypeError as e:
                    # There's an edge case here -- if a Steamship package returns the JSON dictionary
                    #
                    # { "status": "status string" }
                    #
                    # Then the above handler will attempt to parse it and throw... But we don't actually want to throw
                    # since we don't take a strong opinion on what the response type of a package endpoint ought to be.
                    # It *may* choose to conform to the SteamshipResponse<T> type, but it doesn't have to.
                    if not is_package_call:
                        raise e
    
                if task is not None and task.state == TaskState.failed:
                    error = task.as_error()
    
            if "data" in response_data:
                if expect is not None:
                    if issubclass(expect, SteamshipError):
                        data = expect.from_dict({**response_data["data"], "client": self})
                    elif issubclass(expect, BaseModel):
                        data = expect.parse_obj(
                            self._add_client_to_response(expect, response_data["data"])
                        )
                    else:
                        raise RuntimeError(f"obj of type {expect} does not have a from_dict method")
                else:
                    data = response_data["data"]
    
                if task:
                    task.output = data
            else:
                data = response_data
    
        else:
            data = response_data
    
        if error is not None:
            logging.warning(f"Client received error from server: {error}", exc_info=error)
>           raise error
E           steamship.base.error.SteamshipError: [ERROR - POST /streamResultToBlocks] Unable to upload data to the cloud storage service Wrapped Message: Could not upload key spaces/ED6EAF22-58F9-4AAC-8936-23491E65F5EF/242873FD-812F-44A7-9CD5-C46A10172F0A/imports/B50E7896-9EFD-4464-85B0-E163599D87A4 to S3 bucket steamship-spaces-staging to S3

src/steamship/base/client.py:537: SteamshipError