Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gen-ai docs 2nd attempt #961

Closed
wants to merge 19 commits into from

Conversation

paperspaceBen
Copy link
Contributor

No description provided.

This endpoint allows developers to link agent funciton.
operationId: GenAIAPI_LinkAgentFunctionPublic
parameters:
- description: agnet id
Copy link

@acav-do acav-do Jan 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make sure this says agent not agnet

$ref: ../../shared/responses/server_error.yml
default:
$ref: ../../shared/responses/unexpected_error.yml
summary: link agent.
Copy link

@acav-do acav-do Jan 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

create an agent route.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

description: |-
post /v2/gen-ai/agents/{agent_uuid}/knowledge_bases/{knowledge_base_uuid}

This endpoint allows developers to link knowledge base.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont understand this one. I'm assuming this means attaching a knowledge base to an agent? If yes, then

This endpoint allows developers to attach a knowledge base to an agent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

$ref: ../../shared/responses/server_error.yml
default:
$ref: ../../shared/responses/unexpected_error.yml
summary: link knowledge base.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attach knowledge base to agent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

description: |-
get /v2/gen-ai/agents

This endpoint allows developers to returns a list of agents specific to the users context.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This endpoint allows developers to return a list of agents specific to the user's context.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is "This endpoint returns a list of all agents." ??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

description: |-
get /v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources

This endpoint allows developers to list knowledge base data source.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This endpoint allows developers to list knowledge base data sources.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

$ref: ../../shared/responses/server_error.yml
default:
$ref: ../../shared/responses/unexpected_error.yml
summary: list knowledge base data source.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list knowledge base data sources.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

description: |-
get /v2/gen-ai/knowledge_bases

This endpoint allows developers to provides a list of knowledge bases for the user context.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This endpoint allows developers to provide a list of knowledge bases for the user context.

I don't undrstand what "for the user context" means - can you explain?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is "This endpoint returns a list of all knowledge bases." ??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

$ref: ../../shared/responses/server_error.yml
default:
$ref: ../../shared/responses/unexpected_error.yml
summary: list models.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list available models

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

description: |-
put /v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}/regenerate

This endpoint allows developers to regenerate agent api key.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This endpoint allows developers to regenerate an agent api key.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

description: |-
post /v2/gen-ai/indexing_jobs

This endpoint allows developers to start knowledge base indexing job.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to start a knowledge base indexing job.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

description: |-
delete /v2/gen-ai/agents/{agent_uuid}/functions/{function_uuid}

This endpoint allows developers to unlink agent funciton.
Copy link

@acav-do acav-do Jan 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This endpoint allows developers to destroy an agent's function route.

// Just to note that what this is doing is destroying the function route, so it is truly a destructive action. Do we have a confirmation step in the API as an "are you sure you want to destroy this route?" kind of thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

This endpoint allows developers to unlink agent funciton.
operationId: GenAIAPI_UnlinkAgentFunctionPublic
parameters:
- description: The id of the agent to unlink the function from
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The id of the agent the function route belongs to.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

required: true
type: string
- description: |-
The function to remove from the agent
Copy link

@acav-do acav-do Jan 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function route to be destroyed. This does not destroy the function itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

$ref: ../../shared/responses/server_error.yml
default:
$ref: ../../shared/responses/unexpected_error.yml
summary: unlink agent funciton.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Delete an agent's function route.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check

$ref: ../../shared/responses/server_error.yml
default:
$ref: ../../shared/responses/unexpected_error.yml
summary: Regenerate agent api key.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
summary: Regenerate agent api key.
summary: Regenerate API Key for an Agent

$ref: ../../shared/responses/server_error.yml
default:
$ref: ../../shared/responses/unexpected_error.yml
summary: Start knowledge base indexing job.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
summary: Start knowledge base indexing job.
summary: Start Indexing Job for a Knowledge Base

$ref: ../../shared/responses/server_error.yml
default:
$ref: ../../shared/responses/unexpected_error.yml
summary: 'Add Data Source to a Knowledge Base '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
summary: 'Add Data Source to a Knowledge Base '
summary: Add Data Source to a Knowledge Base

$ref: ../../shared/responses/server_error.yml
default:
$ref: ../../shared/responses/unexpected_error.yml
summary: 'Delete API Key for an Agent '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
summary: 'Delete API Key for an Agent '
summary: Delete API Key for an Agent

$ref: ../../shared/responses/server_error.yml
default:
$ref: ../../shared/responses/unexpected_error.yml
summary: 'Delete a Data Source from a Knowledge Base '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
summary: 'Delete a Data Source from a Knowledge Base '
summary: Delete a Data Source from a Knowledge Base

$ref: ../../shared/responses/server_error.yml
default:
$ref: ../../shared/responses/unexpected_error.yml
summary: 'Retrieve Status of Indexing Job for a Knowledge Base '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
summary: 'Retrieve Status of Indexing Job for a Knowledge Base '
summary: Retrieve Status of Indexing Job for a Knowledge Base

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this is just the fact that it is a string

example: '"My Agent Description"'
type: string
instruction:
description: Agent instruction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Agent instruction
description: Agent instruction. Instructions help your agent to perform its job effectively. See [Write Effective Agent Instructions](https://docs.digitalocean.com/products/genai-platform/concepts/best-practices/#agent-instructions) for best practices.

example: '"My Agent"'
type: string
project_id:
description: The id of the DigitalOcean this agent will belong to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: The id of the DigitalOcean this agent will belong to
description: The id of the DigitalOcean project this agent will belong to

example: '"tor1"'
type: string
tags:
example: '["tag1", "tag2"]'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
example: '["tag1", "tag2"]'
description: Agent tag to organize related resources
example: '["tag1", "tag2"]'

name: agent_uuid
required: true
type: string
- description: Knowledge base
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- description: Knowledge base
- description: Knowledge base id

description: Region of bucket
example: example string
type: string
title: Spaces Bucket Data Source
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one still appears in parenthesis.
Screenshot 2025-01-14 at 4 33 30 PM

type: string
type: array
model_uuid:
description: Model id
Copy link
Contributor

@sharmita3 sharmita3 Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: Model id
description: Identifier for the [foundation model](https://docs.digitalocean.com/products/genai-platform/details/models/#foundation-models).

$ref: ../../shared/responses/server_error.yml
default:
$ref: ../../shared/responses/unexpected_error.yml
summary: Attach Knowledge base to Agent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
summary: Attach Knowledge base to Agent
summary: Attach Knowledge Base to an Agent

sharmita3
sharmita3 previously approved these changes Jan 15, 2025
Copy link
Contributor

@sharmita3 sharmita3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -0,0 +1,39 @@
description: To create an agent API key, send a POST request to `/v2/gen-ai/agents/{agent_uuid}/api_keys`.
operationId: Create_an_Agent_API_Key
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
operationId: Create_an_Agent_API_Key
operationId: genAI_agent_api_key_create

Can we follow the naming practice used in the rest of the project for these? When generating API clients from the OpenAPI spec (e.g. https://github.com/digitalocean/pydo), the operationId is used for the method names.

They should be in the format of <namespace>_<operation>. For example: sshKeys_list becomes ssh_keys.list().

So for this one example, we probably want something more like genAI_agent_api_key_create

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amanda requested the operation id be the summary. is it enough to add the genAi_ in front of it?

tags:
- GenAI Platform
x-codeSamples:
- $ref: examples/curl/GenAIAPI_CancelKnowledgeBaseIndexingJobPublic.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- $ref: examples/curl/GenAIAPI_CancelKnowledgeBaseIndexingJobPublic.yml
- $ref: examples/curl/GenAIAPI_CancelKnowledgeBaseIndexingJobPublic.yml
security:
- bearer_auth:
- 'genai:update'

We also need to document the token scopes required for each operation. This can be done by adding a security section with the appropriate scopes under bearer_auth.

- BATCH_JOB_PHASE_SUCCEEDED
- BATCH_JOB_PHASE_FAILED
- BATCH_JOB_PHASE_ERROR
example: example string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
example: example string
example: BATCH_JOB_PHASE_PENDING

A number of the validation errors I'm seeing are for cases like this where the example does not match a valid enum value.

@andrewsomething
Copy link
Member

Closing in favor of the new PR at: #966

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants