Skip to content

SDK no-code app error suggesting my app does not exist #150

@CakeCrusher

Description

@CakeCrusher

Running this:

print(WRITER_APP_ID)
app_res = client.applications.generate_content(
    application_id=WRITER_APP_ID,
    inputs=[
        {
            "id": "name1",
            "value": ["Input1"]
        }
    ]
)

print(app_res.model_dump_json(indent=2))

Results in this:

d1ffa...

---------------------------------------------------------------------------
NotFoundError                             Traceback (most recent call last)
Cell In[16], [line 2](vscode-notebook-cell:?execution_count=16&line=2)
      [1](vscode-notebook-cell:?execution_count=16&line=1) print(WRITER_APP_ID)
----> [2](vscode-notebook-cell:?execution_count=16&line=2) app_res = client.applications.generate_content(
      [3](vscode-notebook-cell:?execution_count=16&line=3)     application_id=WRITER_APP_ID,
      [4](vscode-notebook-cell:?execution_count=16&line=4)     inputs=[
      [5](vscode-notebook-cell:?execution_count=16&line=5)         {
      [6](vscode-notebook-cell:?execution_count=16&line=6)             "id": "name1",
      [7](vscode-notebook-cell:?execution_count=16&line=7)             "value": ["Input1"]
      [8](vscode-notebook-cell:?execution_count=16&line=8)         }
      [9](vscode-notebook-cell:?execution_count=16&line=9)     ]
     [10](vscode-notebook-cell:?execution_count=16&line=10) )
     [12](vscode-notebook-cell:?execution_count=16&line=12) print(app_res.model_dump_json(indent=2))

File c:\Notes\writer\.venv\lib\site-packages\writerai\_utils\_utils.py:275, in required_args.<locals>.inner.<locals>.wrapper(*args, **kwargs)
    [273](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/_utils/_utils.py:273)             msg = f"Missing required argument: {quote(missing[0])}"
    [274](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/_utils/_utils.py:274)     raise TypeError(msg)
--> [275](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/_utils/_utils.py:275) return func(*args, **kwargs)

File c:\Notes\writer\.venv\lib\site-packages\writerai\resources\applications.py:162, in ApplicationsResource.generate_content(self, application_id, inputs, stream, extra_headers, extra_query, extra_body, timeout)
    [160](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:160) if not application_id:
    [161](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:161)     raise ValueError(f"Expected a non-empty value for `application_id` but received {application_id!r}")
--> [162](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:162) return self._post(
    [163](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:163)     f"/v1/applications/{application_id}",
    [164](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:164)     body=maybe_transform(
    [165](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:165)         {
    [166](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:166)             "inputs": inputs,
    [167](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:167)             "stream": stream,
    [168](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:168)         },
    [169](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:169)         application_generate_content_params.ApplicationGenerateContentParams,
    [170](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:170)     ),
    [171](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:171)     options=make_request_options(
    [172](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:172)         extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
    [173](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/resources/applications.py:173)     ),
...
   (...)
   [1069](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/_base_client.py:1069)     retries_taken=retries_taken,
   [1070](file:///C:/Notes/writer/.venv/lib/site-packages/writerai/_base_client.py:1070) )

NotFoundError: Error code: 404 - {'tpe': 'fail.resource.generic', 'errors': [{'description': "Application d1ff... doesn't exist", 'key': 'fail.resource.generic', 'extras': None}], 'extras': None}
Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?b0c42a2e-7cbc-4fb9-bf6d-1ffaaa4160a1) or open in a [text editor](command:workbench.action.openLargeOutput?b0c42a2e-7cbc-4fb9-bf6d-1ffaaa4160a1). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

I know my application exists as I have been using its API key for chat completion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions