Twilio.Knowledge.V2.KnowledgeBase.KnowledgeService (twilio_elixir v0.1.3)

Copy Markdown View Source

Service for Knowledge API operations.

Operations: list, create, fetch, delete

Summary

Functions

Create a new knowledge source from various data sources such as web content, files, or raw text. The knowledge source will be processed and indexed to enable semantic search and retrieval.

Fetch detailed information about a specific knowledge source by its ID. This returns the complete knowledge source object including processing status, source details, and configuration information.

Retrieve a paginated list of all knowledge sources for a specific knowledge base. Knowledge sources represent unstructured data sources such as documents, websites, or text content that can be used for context and information retrieval.

Stream: Retrieve a paginated list of all knowledge sources for a specific knowledge base. Knowledge sources represent unstructured data sources such as documents, websites, or text content that can be used for context and information retrieval. (lazy auto-pagination).

Functions

create(client, kb_id, params \\ %{}, opts \\ [])

@spec create(Twilio.Client.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Resources.Knowledge.V2.KnowledgeBase.Knowledge.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Create a new knowledge source from various data sources such as web content, files, or raw text. The knowledge source will be processed and indexed to enable semantic search and retrieval.

Best practices

To maximize the effectiveness of Knowledge, consider the following best practices:

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

Assess and optimize content: Regularly evaluate your existing Knowledge sources for accuracy, relevance, and coverage. Identify any gaps or outdated information that could hinder the Assistant's performance.

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

Simplify and structure content: Ensure that the content is clear and concise. Use headings, bullet points, and metadata to make information straightforward to navigate for both the AI Assistant and your users.

Prioritize high-impact content: Focus on updating and maintaining content that is frequently accessed or critical to customer interactions. Consider using analytics to determine which Knowledge entries are most valuable.

Operation: CreateKnowledge | Tags: Knowledge

delete(client, kb_id, sid, opts \\ [])

@spec delete(Twilio.Client.t(), String.t(), String.t(), keyword()) ::
  {:ok, map()} | {:ok, map(), map()} | :ok | {:error, Twilio.Error.t()}

credo:disable-for-next-line Credo.Check.Readability.MaxLineLength

Permanently delete knowledge source and all its associated data, including processed chunks and embeddings. This action cannot be undone. The knowledge resource will no longer be available for search or retrieval operations.

Operation: DeleteKnowledge | Tags: Knowledge

fetch(client, kb_id, sid, opts \\ [])

@spec fetch(Twilio.Client.t(), String.t(), String.t(), keyword()) ::
  {:ok, Twilio.Resources.Knowledge.V2.KnowledgeBase.Knowledge.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Fetch detailed information about a specific knowledge source by its ID. This returns the complete knowledge source object including processing status, source details, and configuration information.

Operation: FetchKnowledge | Tags: Knowledge

list(client, kb_id, params \\ %{}, opts \\ [])

@spec list(Twilio.Client.t(), String.t(), map(), keyword()) ::
  {:ok, Twilio.Page.t()}
  | {:ok, map(), map()}
  | :ok
  | {:error, Twilio.Error.t()}

Retrieve a paginated list of all knowledge sources for a specific knowledge base. Knowledge sources represent unstructured data sources such as documents, websites, or text content that can be used for context and information retrieval.

Operation: ListKnowledge | Tags: Knowledge

Query Parameters

ParameterTypeDescription
pageintegerThe page index. This value is simply for client state.

stream(client, kb_id, params \\ %{}, opts \\ [])

@spec stream(Twilio.Client.t(), String.t(), map(), keyword()) :: Enumerable.t()

Stream: Retrieve a paginated list of all knowledge sources for a specific knowledge base. Knowledge sources represent unstructured data sources such as documents, websites, or text content that can be used for context and information retrieval. (lazy auto-pagination).