revelrylabs / prodops_ex

The Elixir SDK for ProdOps
MIT License
0 stars 0 forks source link

Spike - SDK V2 - API Changes Investigation #46

Open estreeper opened 4 months ago

estreeper commented 4 months ago

Background

Determine API modifications needed to support version 2 of the ProdOps SDK.

Acceptance Criteria

Scenario: Identify API changes for ProdOps-SDK-Elixir V2

estreeper commented 4 months ago

Copying in this comment I left in Slack:

I've noticed that in a lot of the docs I'm writing (I'm working on a documentation chatbot right now) the hardest part of the instructions are on how to add the prompt template. I also had to add instructions on creating the Artifact Type and on creating a Collection and adding Data Sources/Documents to it. The last one is probably not such a big deal, because it's probably easier to use a GUI than an API, but adding the Artifact Type and the Prompt Template via the API would be really nice and IMO higher priority. For many of these endpoints, we could also definitely infer a lot of this data. We talked about the artifact_slug, but for instance project_id probably can be as well. For instance, we could go from:

    iex> ProdopsEx.Artifact.create(%{
    ...>   prompt_template_id: 2,
    ...>   artifact_slug: "story",
    ...>   project_id: 1,
    ...>   inputs: [
    ...>     %{name: "Context", value: "this is a test"}
    ...>   ]
    ...> })

to:

    iex> ProdopsEx.Artifact.create(%{
    ...>   prompt_template_id: 2,
    ...>   inputs: [
    ...>     %{name: "Context", value: "this is a test"}
    ...>   ]
    ...> })

We should know which project a prompt_template_id belongs to on the backend. I'm also seeing an issue where I don't think document queries are getting hydrated via API, but I'll need to look into it a bit more

jacksonoberkirch commented 4 months ago

API V2/V3 Proposed Changes:

  1. (POST) Prompt Template creation (new endpoint) (likely will be the most complicated. as will require passing custom inputs, document attachments, and document queries)
  2. (POST) Create Artifact (and stream create) (updating existing endpoint) (need to allow for passing document query values)
  3. (POST) Create Artifact Type (new endpoint)
  4. (POST) Create Project (new endpoint)
  5. (GET) Get documents list (new endpoint) adding more data center endpoints for document management
  6. (POST) Adding data source connection (GitHub) (new endpoint) (passing in route and api key)
  7. (POST) Adding document to collection (New endpoint)
  8. Updating existing routes to not use artifact type slug (no longer necessary with the removal of bespoke artifact types)
  9. (POST) Invite new user to team (new endpoint) (adding endpoints for team admin management
  10. (POST) promote/demote team member/team admin (new endpoint)

Goal here is to allow users to use the SDK/API without the need to ever visit the front end (other than initial account creation)