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

Enhancement: Ability to select an agent as the default for new chats #5000

Open
1 task done
acehoss opened this issue Dec 15, 2024 · 20 comments
Open
1 task done

Enhancement: Ability to select an agent as the default for new chats #5000

acehoss opened this issue Dec 15, 2024 · 20 comments
Labels
enhancement New feature or request

Comments

@acehoss
Copy link

acehoss commented Dec 15, 2024

What features would you like to see added?

Maybe agents could appear in the preset list, allowing them to be selected as the default for new chats? Or some other way? But when starting a new chat, I'd like for an agent to be preselected.

More details

I have an agent made with the agent builder that I use for 95% of conversations, and every time I start a new chat I need to @ the agent in the chat box to select it.

Which components are impacted by your request?

No response

Pictures

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@acehoss acehoss added the enhancement New feature or request label Dec 15, 2024
@dvejsada
Copy link

You can do this using a modelSpec https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/model_specs

You can set a specific agent as "endpoint" and even make it as default.

@acehoss
Copy link
Author

acehoss commented Dec 15, 2024

@dvejsada thanks for the suggestion! I gave it a try, but I couldn't figure out how to get it to select the agent I built in the agent builder. Additionally, all of the other endpoints disappeared. It seems like I'd have to manually set up model specs for everything I wanted to be able to use if I took this approach.

Additionally, my agent uses some custom actions, which don't appear to be configurable from the model specs.

I'd like to be able to select an agent that I built with the agent builder as the default.

@danny-avila
Copy link
Owner

danny-avila commented Dec 16, 2024

@acehoss I'm planning on implementing something similar to ChatGPT with the way they allow pinning GPTs:
firefox_ofKCnG9Sxx

Open to feedback, presets would also solve this.

@acehoss
Copy link
Author

acehoss commented Dec 16, 2024

@danny-avila That sounds even better than presets, the main thing I'd like is one-click activation of an agent. This would allow one-click activation of various agents, which is more powerful than default activation of one agent. 💯

@zeitderforschung
Copy link

zeitderforschung commented Dec 18, 2024

You can do this using a modelSpec https://www.librechat.ai/docs/configuration/libre
chat_yaml/object_structure/model_specs

You can set a specific agent as "endpoint" and even make it as default.

How did you manage to create an agent when modelSpecs were active? Changing the selection to "Agents" to show the Agent Builder was not possible once a modelSpec was configured. The menu entry "Agents" was there, but I could not select it. Without a modelSpec everything worked fine. I am already running the latest development build.

image

My environment:

ENDPOINTS=azureOpenAI,agents
EXPERIMENTAL_AGENTS=true

My librechat.yaml:

interface:
  endpointsMenu: true

endpoints:
  azureOpenAI:
  ...

modelSpecs:
  list:
    - name: "yourcompany-gpt"
      preset:
        default: true
        endpoint: "azureOpenAI"

@dvejsada
Copy link

You can do this using a modelSpec https://www.librechat.ai/docs/configuration/libre
chat_yaml/object_structure/model_specs

You can set a specific agent as "endpoint" and even make it as default.

How did you manage to create an agent when modelSpecs were active? Changing the selection to "Agents" to show the Agent Builder was not possible once a modelSpec was configured. The menu entry "Agents" was there, but I could not select it. Without a modelSpec everything worked fine. I am already running the latest development build.

image

My environment:

ENDPOINTS=azureOpenAI,agents
EXPERIMENTAL_AGENTS=true

My librechat.yaml:

interface:
  endpointsMenu: true

endpoints:
  azureOpenAI:
  ...

modelSpecs:
  list:
    - name: "yourcompany-gpt"
      preset:
        default: true
        endpoint: "azureOpenAI"

You can do modelSpec with endpoint "agents", which will allow you to create/edit agents. Once you have your agent created, just add the agent_id to keep the modelSpec endpoint for specific agent only (if preferred).

@Tsounguinzo
Copy link

You can do this using a modelSpec https://www.librechat.ai/docs/configuration/libre
chat_yaml/object_structure/model_specs
You can set a specific agent as "endpoint" and even make it as default.

How did you manage to create an agent when modelSpecs were active? Changing the selection to "Agents" to show the Agent Builder was not possible once a modelSpec was configured. The menu entry "Agents" was there, but I could not select it. Without a modelSpec everything worked fine. I am already running the latest development build.
image
My environment:

ENDPOINTS=azureOpenAI,agents
EXPERIMENTAL_AGENTS=true

My librechat.yaml:

interface:
  endpointsMenu: true

endpoints:
  azureOpenAI:
  ...

modelSpecs:
  list:
    - name: "yourcompany-gpt"
      preset:
        default: true
        endpoint: "azureOpenAI"

You can do modelSpec with endpoint "agents", which will allow you to create/edit agents. Once you have your agent created, just add the agent_id to keep the modelSpec endpoint for specific agent only (if preferred).

what do you mean by "add the agent_id", where do we get that id from and how do we add that Id in the model spec I cant find it in the docs also can I make that agent as default like we do with other models?

@mbiskach
Copy link

I too am attempting to create a modelSpec that uses the endpoint "agents" and allows for creating/editing agents. Here is my librechat.yaml as an example:

# librechat.yaml
endpoints:

# Example existing custom endpoint
  custom:
  - name: "<redacted>"
  ...
    models:
      default: ["claude-3.5-haiku", ...]

  agents:
    disableBuilder: false

modelSpecs:
  enforce: false
  prioritize: true
  list:
    # Example modelSpec based on custom endpoint
    - name: "<redacted>"
    ...

    # Is the following correct?
    - name: "agents"
      label: "Agents"
      preset:
        endpoint: "agents"
        model: "claude-3.5-haiku"

Currently I see both modelSpecs visible in the dropdown select menu, but I can't create/edit agents (agent builder is not visible). When I use endpoints only (instead of modelSpecs), I do see the agent builder.

@Balzabu
Copy link

Balzabu commented Jan 1, 2025

I can confirm that forcing modelSpecs to use the "agents" endpoint will make the Agents Builder not appear therefore making the endpoint not usable if no Assistant ID is hardcoded in the configs.

@danny-avila
Copy link
Owner

@Balzabu @mbiskach That is default behavior for using modelSpecs.

You need to override the default interface settings as mentioned in the docs: https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/model_specs#overview

https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/interface

@Balzabu
Copy link

Balzabu commented Jan 1, 2025

Hello @danny-avila, thanks for your fast reply and happy beginning of this new year.
I will retry once I have some time and try apply your suggestions.

I will update this comment when possible.


Edit: I can confirm this does work as intended.

librechat.yaml

interface:
  endpointsMenu: true    # Ensure the endpoints menu is visible
  modelSelect: true      # Enable model selection
  parameters: true       # Show configurable parameters
  sidePanel: true        # Ensure the side panel is displayed
  presets: true          # Enable presets
  agentBuilder: true     # Explicitly enable the agent builder

modelSpecs:
  enforce: true
  prioritize: true
  list:
    - name: "lorem-ipsum"
      label: "Lorem Ipsum"
      description: "Lorem Ipsum"
      preset:
        default: true
        endpoint: "agents"

image

@mbiskach
Copy link

mbiskach commented Jan 3, 2025

@danny-avila I added agentBuilder: true and agents: true to the interface settings, but when using modelSpecs, agent builder does not show (for endpoints it does).

interface:
  agents: true
  agentBuilder: true

The rest of the librechat.yaml continues from above

@Balzabu
Copy link

Balzabu commented Jan 3, 2025

@danny-avila I added agentBuilder: true and agents: true to the interface settings, but when using modelSpecs, agent builder does not show (for endpoints it does).

interface:
  agents: true
  agentBuilder: true

The rest of the librechat.yaml continues from above

Hello, did you have the chance to apply the configuration I used last time? With the one I specified it is working fine.
Also, might be a stupid question, but are you rebuilding the project after changing these parameters?

In my case I had to disable Cloudflare Caching and rebuild with docker compose in order to see the Builder in the sidebar.

@zeitderforschung
Copy link

This minimal librechat config works for me.

interface:
  endpointsMenu: false
  modelSelect: false
  parameters: true  # 👉 Must be enabled, else there is no agent builder!
  agents: true

modelSpecs:
  list:
    - name: "Agents"
      label: "Agents"
      preset:
        endpoint: "agents"
        # Optionally set a default agent, get the id from mongodb > "LibreChat" database > "agents" table
        # agent_id: "agent_NqhNPxoUp9coJ4BFZIEF3"

@danny-avila
Copy link
Owner

For what it's worth, I've added URL query params for using agents via links to your instance:
https://www.librechat.ai/docs/features/url_query

I've also extensively updated model specs documentation for correct usage:
https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/model_specs

you should simply use the following when configuring agents via specs:

      preset:
        endpoint: "agents"
        agent_id: "agent_someUniqueId"

https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/model_specs#agent-options

@mbiskach
Copy link

This minimal librechat config works for me.

interface:
  endpointsMenu: false
  modelSelect: false
  parameters: true  # 👉 Must be enabled, else there is no agent builder!
  agents: true

modelSpecs:
  list:
    - name: "Agents"
      label: "Agents"
      preset:
        endpoint: "agents"
        # Optionally set a default agent, get the id from mongodb > "LibreChat" database > "agents" table
        # agent_id: "agent_NqhNPxoUp9coJ4BFZIEF3"

parameters: true solved my issue. Thanks @zeitderforschung !

@danny-avila thank you for the updates!

@danny-avila
Copy link
Owner

@mbiskach I recently changed this so that you don't need parameters: true for the builder show up, rather you should rely on disableBuilder to disable the builder for the interface:

https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/agents#disablebuilder

@Pfaufisch
Copy link

@danny-avila You think we can have the uploaded image for an agent appear in the modelSpec list?
CleanShot 2025-01-15 at 09 51 28@2x

@dvejsada
Copy link

@danny-avila You think we can have the uploaded image for an agent appear in the modelSpec list? CleanShot 2025-01-15 at 09 51 28@2x

You can do this by setting "iconURL" in the modelSpec.

@ghowe
Copy link

ghowe commented Jan 18, 2025

I was able to pull in the icons by copying the list code from the assistant builder as a submenu. Let me know if you the code.
Image

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

No branches or pull requests

9 participants