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

[Obs AI Assistant] Rename chat completion methods to align with LLM vendor terminology #205583

Open
sorenlouv opened this issue Jan 6, 2025 · 6 comments
Assignees
Labels
Team:Obs AI Assistant Observability AI Assistant

Comments

@sorenlouv
Copy link
Member

sorenlouv commented Jan 6, 2025

Problem

The Obs AI Assistant exposes two chat completion methods: chat and complete. These names don't accurately describe their behaviour and does not align with LLM vendor terminology. This makes it more difficult when getting started working with the AI Assistant as a developer

The primary difference between the two methods is that:

  • chat only calls chat completion API once
  • complete resolves function (tool) requests and will therefore recursively call the chat completion API. It does this by calling chat under the hood.

Solution

  • Rename chat to chatCompletion.
  • Rename complete to runTools

LLM Terminology

API endpoints

We should also consider renaming the API endpoints:

  • POST /internal/observability_ai_assistant/chat to POST /internal/observability_ai_assistant/chat/completion
  • POST /internal/observability_ai_assistant/chat/complete to /internal/observability_ai_assistant/chat/completion/run_tools
  • POST /api/observability_ai_assistant/chat/complete to /api/observability_ai_assistant/chat/run_tools
@sorenlouv sorenlouv added the Team:Obs AI Assistant Observability AI Assistant label Jan 6, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

@dgieselaar
Copy link
Member

OpenAI calls this runTools (which I would personally prefer over recursiveChatCompletion) https://github.com/openai/openai-node#automated-function-calls

@sorenlouv
Copy link
Member Author

OpenAI calls this runTools (which I would personally prefer over recursiveChatCompletion) https://github.com/openai/openai-node#automated-function-calls

@dgieselaar I agree. recursiveChatCompletion didn't feel quite right. Personally I'd prefer something that clearly indicates that it does chat completion like chatCompletionWithTools. That being said, I'd rather use the industry terms than inventing our own so I'm good with runTools

@sorenlouv
Copy link
Member Author

Handing this over to @viduni94 since she is already working on it

@viduni94
Copy link
Contributor

Handing this over to @viduni94 since she is already working on it

Thank you @sorenlouv
I'll take this over.

@viduni94
Copy link
Contributor

Before publishing the docs for our public chat complete API, we need to make sure that the properties and API endpoint conform with up to date terminology.

For example:

  • We have API params named function_call, which needs to be renamed to tool_call
  • And all references to function needs to be renamed to tool

Relates to https://github.com/elastic/obs-ai-assistant-team/issues/193
Draft PR for the public API documentation - #206869

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Obs AI Assistant Observability AI Assistant
Projects
None yet
4 participants