Skip to content

Conversation

@git-hulk
Copy link

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) More detailed description for this PR(en: English/zh: Chinese).

  • Add prompt management client with list, get, create, update operations
  • Include comprehensive test coverage for all prompt operations
  • Support chat message placeholders and prompt compilation

- Add prompt management client with list, get, create, update operations
- Include comprehensive test coverage for all prompt operations
- Support chat message placeholders and prompt compilation
@git-hulk
Copy link
Author

@mrh997 Would you mind having a look at this PR?

@shentongmartin
Copy link
Contributor

建议在 example 和 readme 中增加如何使用的示例和说明

@shentongmartin
Copy link
Contributor

在 Eino 中提供 langfuse 的 prompt 管理,这个功能的主要使用场景是什么?应该不是在编排中使用

@codingcn
Copy link

在 Eino 中提供 langfuse 的 prompt 管理,这个功能的主要使用场景是什么?应该不是在编排中使用

不需要将prompt硬编码到代码中,可以在远程管理prompt,类似于etcd、nacos等远程管理配置一样

@shentongmartin
Copy link
Contributor

在 Eino 中提供 langfuse 的 prompt 管理,这个功能的主要使用场景是什么?应该不是在编排中使用

不需要将prompt硬编码到代码中,可以在远程管理prompt,类似于etcd、nacos等远程管理配置一样

如果是这种使用场景,感觉应该实现一个基于 langfuse 的 ChatTemplate,这样才能在编排中用?

@codingcn
Copy link

在 Eino 中提供 langfuse 的 prompt 管理,这个功能的主要使用场景是什么?应该不是在编排中使用

不需要将prompt硬编码到代码中,可以在远程管理prompt,类似于etcd、nacos等远程管理配置一样

如果是这种使用场景,感觉应该实现一个基于 langfuse 的 ChatTemplate,这样才能在编排中用?

@git-hulk 看看是否和其它语言的用法对齐下,比如通过compile实现参数绑定movie

https://langfuse.com/docs/prompt-management/get-started#use-prompt

# Get current `production` version of a chat prompt
chat_prompt = langfuse.get_prompt("movie-critic-chat", type="chat") # type arg infers the prompt type (default is 'text')
 
# Insert variables into chat prompt template
compiled_chat_prompt = chat_prompt.compile(criticlevel="expert", movie="Dune 2")
# -> [{"role": "system", "content": "You are an expert movie critic"}, {"role": "user", "content": "Do you like Dune 2?"}]

@git-hulk
Copy link
Author

在 Eino 中提供 langfuse 的 prompt 管理,这个功能的主要使用场景是什么?应该不是在编排中使用

不需要将prompt硬编码到代码中,可以在远程管理prompt,类似于etcd、nacos等远程管理配置一样

如果是这种使用场景,感觉应该实现一个基于 langfuse 的 ChatTemplate,这样才能在编排中用?

@git-hulk 看看是否和其它语言的用法对齐下,比如通过compile实现参数绑定movie

https://langfuse.com/docs/prompt-management/get-started#use-prompt

# Get current `production` version of a chat prompt
chat_prompt = langfuse.get_prompt("movie-critic-chat", type="chat") # type arg infers the prompt type (default is 'text')
 
# Insert variables into chat prompt template
compiled_chat_prompt = chat_prompt.compile(criticlevel="expert", movie="Dune 2")
# -> [{"role": "system", "content": "You are an expert movie critic"}, {"role": "user", "content": "Do you like Dune 2?"}]

我比较倾向于单独支持 Eino's ChatTemplate 的实现来渲染 Langfuse Prompt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants