Enum ApiPath

Source
pub enum ApiPath {
Show 17 variants ChatMessages, FilesUpload, ChatMessagesStop, MessagesFeedbacks, MessagesSuggested, Messages, Conversations, ConversationsDelete, ConversationsRename, AudioToText, TextToAudio, Parameters, Meta, WorkflowsRun, WorkflowsStop, CompletionMessages, CompletionMessagesStop,
}
Expand description

API 路径

Variants§

§

ChatMessages

发送对话消息, 创建会话消息。

§

FilesUpload

上传文件 上传文件(目前仅支持图片)并在发送消息时使用,可实现图文多模态理解。
支持 png, jpg, jpeg, webp, gif 格式。
上传的文件仅供当前终端用户使用。

§

ChatMessagesStop

停止响应, 仅支持流式模式。

§

MessagesFeedbacks

消息反馈(点赞, 消息终端用户反馈、点赞,方便应用开发者优化输出预期。

§

MessagesSuggested

获取下一轮建议问题列表

§

Messages

获取会话历史消息, 滚动加载形式返回历史聊天记录,第一页返回最新 limit 条,即:倒序返回。

§

Conversations

获取会话列表, 获取当前用户的会话列表,默认返回最近的 20 条。

§

ConversationsDelete

删除会话

§

ConversationsRename

会话重命名, 对会话进行重命名,会话名称用于显示在支持多会话的客户端上。

§

AudioToText

语音转文字

§

TextToAudio

文字转语音

§

Parameters

获取应用配置信息, 用于进入页面一开始,获取功能开关、输入参数名称、类型及默认值等使用。

§

Meta

获取应用Meta信息, 用于获取工具icon

§

WorkflowsRun

workflow 执行 workflow

§

WorkflowsStop

停止响应, 仅支持流式模式。

§

CompletionMessages

completion 文本生成 发送请求给文本生成型应用

§

CompletionMessagesStop

文本生成停止响应

Implementations§

Source§

impl ApiPath

API 路径

Source

pub fn as_str(&self) -> &'static str

获取 API 路径

§Example
use dify_client::api::ApiPath;
let path = ApiPath::ChatMessages;
assert_eq!(path.as_str(), "/v1/chat-messages");

Trait Implementations§

Source§

impl Debug for ApiPath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for ApiPath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> ToStringFallible for T
where T: Display,

Source§

fn try_to_string(&self) -> Result<String, TryReserveError>

ToString::to_string, but without panic on OOM.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,