alfin06/swegent-issues-filtered huggingface dataset:
[Bug]: Gemini missing message in history

### Describe the bug

When calling Gemini, The last message is missing when the message history is 
```python
[{
"role": "system",
"content": "You are in a debate with others, please first claim whether you are for or against the topic, and explain why."
},
{
"role": "user",
"content": "Debate Topic: Should vaccination be mandatory?"
}]
```

Reason: The messages are not merged correctly in function `_oai_messages_to_gemini_messages` 


### Steps to reproduce

1. Add those print lines in `gemini.py`
<img width="892" alt="Screenshot 2024-06-09 at 5 48 00 PM" src="https://github.com/microsoft/autogen/assets/32823396/af307a21-a953-40a4-b581-f56b86236ea4">

2. run this code:
```python
import autogen
from autogen import OpenAIWrapper

def model_call_example_function(
        model: str,
        message: str,
        cache_seed: int = None,
):
    config_list = autogen.config_list_from_json(
        "OAI_CONFIG_LIST",
        filter_dict={
            "model": [model],
        }
    )
    client = OpenAIWrapper(config_list=config_list)
    response = client.create(
        messages=[{"role": "system", "content": "You are in a debate with others, please first claim whether you are for or against the topic, and explain why."},
            {"role": "user", "content": message}],
        cache_seed=cache_seed
    )

    print(f"\n\nResponse from model {model}: {response.choices[0].message.content}")

    client.print_usage_summary()

model_call_example_function(
    model="gemini-1.5-pro-latest",
    message="Debate Topic: Should vaccination be mandatory?"
)
```


Output:
```
Chat History []
Input Message:  You are in a debate with others, please first claim whether you are for or against the topic, and explain why.


Response from model gemini-1.5-pro-latest: Please provide me with the debate topic! I need to know what we're debating before I can tell you my stance. 😄 

Give me the topic, and I'll be happy to craft a compelling argument for or against it!  

----------------------------------------------------------------------------------------------------
Usage summary excluding cached usage: 
Total cost: 0.00125
* Model 'gemini-1.5-pro-latest': cost: 0.00125, prompt_tokens: 25, completion_tokens: 51, total_tokens: 76

All completions are non-cached: the total cost with cached completions is the same as actual cost.
----------------------------------------------------------------------------------------------------
```

We can see the debate topic is not in chat history, and not in "Input Message:"


State: closed
[Feature Request] Make TerminalToolkit as MCP

### Required prerequisites

- [x] I have searched the [Issue Tracker](https://github.com/camel-ai/camel/issues) and [Discussions](https://github.com/camel-ai/camel/discussions) that this hasn't already been reported. (+1 or comment there if it has.)
- [ ] Consider asking first in a [Discussion](https://github.com/camel-ai/camel/discussions/new).

### Motivation

could refer to examples/toolkits/mcp/mcp_arxiv_toolkit/client.py

make it as one standalone package like the one @MuggleJinx made previously: https://github.com/camel-ai/camel-toolkits-mcp

### Solution

_No response_

### Alternatives

_No response_

### Additional context

_No response_

Labels: enhancement, P1
State: closed
Vertex AI Model gives error on system message input and connected text input

### Bug Description

When adding system message and input via for example prompt builder I am receiving error.

Error Message:
Error Building Component:
Error building Component Vertex AI: Expected mapping type as input to ChatPromptTemplate. Received <class 'list'>.

### Reproduction

Connected Input, no System message
![image](https://github.com/user-attachments/assets/313999f5-23f5-403a-a4cd-d4d14ddd5349)

No connected Input + system message
![image](https://github.com/user-attachments/assets/cd8ada53-d9e3-451b-82d7-a0c3f22d3808)

Connected Input + system message
![image](https://github.com/user-attachments/assets/e5027d98-c188-4a2c-a5a6-090efa0c1157)

### Expected behavior

It should not give errors

### Who can help?

_No response_

### Operating System

Windows 11

### Langflow Version

1.0.12

### Python Version

None

### Screenshot

_No response_

### Flow File

_No response_

Labels: bug
State: closed
vllm_worker - Mixtral - Tokenizer points to TokenizerGroup object

When self.tokenizer is referred to in the vllm_worker, it points to a TokenizerGroup object, which has no attributes / functions such as eos_token_id or decode.

This can be rectified by initialising

self.tokenizer = llm_engine.engine.tokenizer.tokenizer,

instead of

self.tokenizer = llm_engine.engine.tokenizer (Which is existing right now)

This is only observed for the Mixtral model right now, but not for other models. So, it is required to implement checks whether the type is a TokenizerGroup, if yes, do this.

State: closed
Messages Stored With Same Timestamp

### Bug Description

Every message is stored with the same timestamp. Note the actual time when I will send some of them.


### Reproduction

get the memory starter example
interact with chat a couple of times
go to default session and check the timestamp

### Expected behavior

The timestamp should match the time the user is interacting.



### Who can help?

@anovazzi1 

### Operating System

Mac

### Langflow Version

1.0.12

### Python Version

3.12

### Screenshot

<img width="1349" alt="image" src="https://github.com/user-attachments/assets/7e1cbdd5-c567-4126-823d-740779e10cfe">


### Flow File

[Memory Chatbot (1).json](https://github.com/user-attachments/files/16392403/Memory.Chatbot.1.json)


Labels: bug
State: closed
[BUG] $ref cannot have keywords {'description'}.

### Required prerequisites

- [x] I have read the documentation <https://camel-ai.github.io/camel/camel.html>.
- [x] I have searched the [Issue Tracker](https://github.com/camel-ai/camel/issues) and [Discussions](https://github.com/camel-ai/camel/discussions) that this hasn't already been reported. (+1 or comment there if it has.)
- [x] Consider asking first in a [Discussion](https://github.com/camel-ai/camel/discussions/new).

### What version of camel are you using?

0.2.74

### System information

3.10.12 (main, May 27 2025, 17:12:29) [GCC 11.4.0] linux
0.2.74

### Problem description
When some argument in tool schema contains $ref, the description field will trigger an error when call the OpenAI models.

```python
model = ModelFactory.create(
    model_platform=ModelPlatformType.AZURE,
    model_type=ModelType.GPT_4O,
    model_config_dict=ChatGPTConfig(temperature=0.2).as_dict(),
    api_version="2024-12-01-preview",
    api_key=os.getenv("AZURE_OPENAI_API_KEY"),
    url=os.getenv("AZURE_OPENAI_ENDPOINT"),
    azure_deployment_name="gpt-4o",
)
agent = ChatAgent(
    system_message="You are a helpful assistant. When I say Bye, you should say Goodbye and terminate the conversation.",
    model=model,
    tools=[FunctionTool(save_user_info)],
    response_terminators=[terminators.ResponseWordsTerminator(words_dict={"bye": 1})],
)
```

Tool Function:
```python
def save_user_info(user: User):
    """
    Save user input to a file.
    Args:
        user: User
    Returns:
        User
    """
    return user
```

Generated Tool Schema:
```yaml
- function:
    description: Save user input to a file.
    name: save_user_info
    parameters:
      $defs:
        User:
          additionalProperties: false
          properties:
            age:
              type: integer
            email:
              type: string
            name:
              type: string
          required:
          - name
          - age
          - email
          type: object
      additionalProperties: false
      properties:
        user:
          $ref: '#/$defs/User'
          description: User
      required:
      - user
      type: object
    strict: true
  type: function
```

Error: 
```
camel.models.model_manager.ModelProcessingError: Unable to process messages: the only provided model did not run successfully. Error: Error code: 400 - {'error': {'message': "Invalid schema for function 'save_user_info': context=('properties', 'user'), $ref cannot have keywords {'description'}.", 'type': 'invalid_request_error', 'param': 'tools[0].function.parameters', 'code': 'invalid_function_parameters'}}
```

### Additional context

https://github.com/OAI/OpenAPI-Specification/issues/1514

Labels: bug, call for contribution, P0
State: closed
Unsupported message type Error

### Bug Description

This bug is related to langchain-core version 0.2.24 and causes the prompt component to break other components.



### Reproduction

Run langflow 1.0.13 and run the Basic Prompting starter project with updated OpenAI component.

### Expected behavior

The starter project should work normally.

### Who can help?

_No response_

### Operating System

MacOS

### Langflow Version

1.0.13

### Python Version

3.12

### Screenshot

_No response_

### Flow File

_No response_

Labels: bug
State: closed
[Feature Request] Integrate Nebius

### Required prerequisites

- [x] I have searched the [Issue Tracker](https://github.com/camel-ai/camel/issues) and [Discussions](https://github.com/camel-ai/camel/discussions) that this hasn't already been reported. (+1 or comment there if it has.)
- [x] Consider asking first in a [Discussion](https://github.com/camel-ai/camel/discussions/new).

### Motivation

Integrate Nebius as a model provider


### Solution

_No response_

### Alternatives

_No response_

### Additional context

_No response_

Labels: enhancement
State: closed
[Feature Request] Integrate Dingtalk platform

### Required prerequisites

- [x] I have searched the [Issue Tracker](https://github.com/camel-ai/camel/issues) and [Discussions](https://github.com/camel-ai/camel/discussions) that this hasn't already been reported. (+1 or comment there if it has.)
- [ ] Consider asking first in a [Discussion](https://github.com/camel-ai/camel/discussions/new).

### Motivation

Integrate Dingtalk platform https://www.dingtalk.com/en  as one toolkit into CAMEL via API/MCP, agent could call this tool to fetch information from Dingtalk and also be able to send message

### Solution

_No response_

### Alternatives

_No response_

### Additional context

_No response_

Labels: New Feature, P0, Tool, CAMEL 2.0
State: closed
generate assistant message id from backend side

### Feature Description

We have a chat backend with persistence layer, so everytime user refresh page will keep track of the history messages. So it's  necessary that keep message id constant everytime user popup a new message.

But I found that in StreamResponse protocol there is only possible to return text and data. But there's no `id`. and the reason of `generateId` is not working because it means id is generated from frontend, but for the ai message, it's actually generated from backend. So it won't work.


### Use Case

I have some features that will allow user to custimize ai chat message per different browser session. Like double click edit, mark, quote, and index sources. So it's important to keep id constant with backend.

### Additional context

my current workaround

```ts
  onFinish: useCallback(
      (message: Message) => {
        // handle the AI message generated by the backend, because id is not returned in the response,
        //  we need to fetch the latest session to get the id of the last message
        getChatSessionFromBackend({
          sessionId,
        })
          .then((newSession) => {
            const lastAIMessage = newSession.chat_messages
              ?.sort((a, b) => (a.index > b.index ? 1 : -1))
              .at(-1);
            if (lastAIMessage?.role !== "assistant") {
              throw unexpected()
              return;
            } else {
              const id = lastAIMessage.id;
              storeMessage({ ...message, id }) // store message to indexeddb
              });
            }
          })
          .then(async () => {
            await refetch();
          })
      },
      [pipelineId, refetch],
    ),
```

Labels: feature, ai/ui
State: closed
Support Partial Tool Results / AsyncGenerator for Tool Calls in streamText

### Feature Description

For tool calls which take a couple of seconds to finish, it would be useful if partial tool results were supported so that the UI can reflect incremental progress.

For server side tools, this could be implemented by allowing `execute` to be an `AsyncGenerator`. This is similar to how the `generate` function in `streamUI` allows for intermediate updates to the UI:
https://github.com/vercel/ai/blob/8653fe5a9c01e7a9f9e0df135652bc5514054f4f/packages/ai/README.md?plain=1#L136-L141

For client side tools, it could be done with an `addPartialToolResult`.

```js
import { stream } from "fetch-event-stream"

onToolCall: async ({ toolCall }) => {

  if (toolCall.name == "searchWeb") {
	const events = await stream('http://websearch.tool?q=' + encodeURIComponent(toolCall.args.query), {
		method: 'POST',
		body: JSON.stringify({
			stream: true,
		}),
	});
	for await (const event of events) {
		addPartialToolResult({data: JSON.parse(event.data) })
	}
  }

}
```

In both cases, we could add a new stream part `toolResultDeltaStreamPart` that handles this. Similar to how partial tool calls `toolCallDeltaStreamPart` are supported when arguments are being generated:
https://github.com/vercel/ai/blob/8653fe5a9c01e7a9f9e0df135652bc5514054f4f/packages/ui-utils/src/stream-parts.ts#L334

### Use Case

Take for example a web search tool. The flow would be something like

```
{"message":"searching web"}
{"message":"links found!"}
{"message":"crawling links..."}
{"message":"results"}
```

Huggingface has a good reference implementation [here](https://github.com/huggingface/chat-ui/blob/main/src/lib/server/websearch/runWebSearch.ts) of that behavior, where it emits intermediate [updates to its UI](https://huggingface.co/chat/).

### Additional context

Tools implemented with edge functions typically time out if no response is given within a fixed limit like 10s or 30s.

A mix of returning an `event-stream` with `waitUntil` gets around that limitation.

```
      return new Response(readable, {
        headers: {
          "Content-Type": "text/event-stream",
          "Transfer-Encoding": "chunked",
          "content-encoding": "identity",
        },
      });
```

Labels: feature, ai/core
State: closed
[BUG] Condition needs to be modified to check if self.llm is either of LLM or BaseLLM classes

https://github.com/crewAIInc/crewAI/blob/a0fcc0c8d19d212e5b24cbcc3563ddcbb36d88cd/src/crewai/lite_agent.py#L212

Looks like the above condition is supposed to check if `self.llm` is an instance of either `BaseLLM` or `LLM`

I found this issue when I tried to used the guardrails with the `CustomLLM` class that is inherited from `BaseLLM`.

Requesting to please check this condition and update accordingly.

Thanks

State: closed
[Feature Request] Add stream response mode configuration for cumulative or delta content

### Required prerequisites

- [x] I have searched the [Issue Tracker](https://github.com/camel-ai/camel/issues) and [Discussions](https://github.com/camel-ai/camel/discussions) that this hasn't already been reported. (+1 or comment there if it has.)
- [ ] Consider asking first in a [Discussion](https://github.com/camel-ai/camel/discussions/new).

### Motivation

Currently, the streaming response logic in `ChatAgent` always returns the accumulated content with each chunk. If the stream contains many chunks, the response body will grow larger and larger, resulting in bandwidth waste and increased memory pressure.
It would be beneficial to add a configuration option (e.g., `stream_accumulate_mode`) to allow users to choose between returning accumulated content (`accumulate`, the current behavior) or only the incremental content (`delta`) for each chunk. This enhancement would make the system more flexible and efficient for different use cases.

### Solution

1. Add a `stream_accumulate_mode` parameter to the `ChatAgent` class (default: `accumulate`).
2. Update the `StreamContentAccumulator` and streaming response logic to use this configuration, so the agent can return either accumulated content or only the new content for each chunk.

### Alternatives

_No response_

### Additional context

_No response_

Labels: enhancement, good first issue, New Feature, call for contribution, P1
State: closed
[.Net][Document]: Use AutoGen.Net agent as model in AG Studio  

- Using `AutoGen.WebAPI`, you can now start an openai chat backend from an `IAgent`
- You can add third-party OpenAI model in AutoGen Studio

Ipso facto, you can consume AutoGen.Net agents in AutoGen Studio as an OpenAI model by starting a web api from `IAgent` using `AutoGen.WebAPI`

# TODO

Turn the following steps into tutorial and put it on AutoGen.Net webside

## Step 1. Create dotnet empty web app and install `AutoGen` and `AutoGen.WebAPI` package
```bash
dotnet new web
dotnet add package AutoGen
dotnet add package AutoGen.WebAPI
```

## Step 2. Replace the Program.cs with following code
```csharp
using AutoGen.Core;
using AutoGen.Service;

var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

var helloWorldAgent = new HelloWorldAgent();
app.UseAgentAsOpenAIChatCompletionEndpoint(helloWorldAgent);

app.Run();

class HelloWorldAgent : IAgent
{
    public string Name => "HelloWorld";

    public Task<IMessage> GenerateReplyAsync(IEnumerable<IMessage> messages, GenerateReplyOptions? options = null, CancellationToken cancellationToken = default)
    {
        return Task.FromResult<IMessage>(new TextMessage(Role.Assistant, "Hello World!", from: this.Name));
    }
}
```

## Step 3: Start the web app
Run the following command to start web api
```bash
dotnet run
```
The web api will listen at `http://localhost:5264/v1/chat/completion

![image](https://github.com/user-attachments/assets/6b208b5b-4df1-44fa-b8d2-1ca0f3b4298f)

## Step 4: In another terminal, start autogen-studio 
```bash
autogenstudio ui
```

## Step 5: Navigate to AutoGen Studio UI and add hello world agent as openai Model

### Step 5.1: Go to model tab
![image](https://github.com/user-attachments/assets/b099b8e0-ccc8-437e-a145-17871d22849f)

### Step 5.2: Select "OpenAI model" card
![image](https://github.com/user-attachments/assets/3ebef964-d7c4-4bb9-8398-1aa8cb897971)

### Step 5.3: Fill the model name and url

The model name needs to be same with agent name

![image](https://github.com/user-attachments/assets/4a475537-06f5-426a-a617-4891d53a6155)

### Step 6: Create a hello world agent that uses the hello world model
![image](https://github.com/user-attachments/assets/863ecec6-02f6-4723-b189-03049e3b2d37)

![image](https://github.com/user-attachments/assets/76b645db-85bf-4d53-8c5c-475bf022e471)

### Final Step: Use the hello world agent in workflow
![image](https://github.com/user-attachments/assets/76da646c-412a-4c2b-8816-f233d1289ec2)
![image](https://github.com/user-attachments/assets/4549b8fd-eebd-4d4a-8287-c32c51550827)
![image](https://github.com/user-attachments/assets/2cd38370-1a81-4e19-b56b-3b503764abcf)





Labels: documentation, dotnet
State: closed
unable to handle inconsistent tool call indices with streaming output when using Qwen3

### Checked other resources

- [x] I added a very descriptive title to this issue.
- [x] I used the GitHub search to find a similar question and didn't find it.
- [x] I am sure that this is a bug in LangChain rather than my code.
- [x] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
- [x] I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

### Example Code

from langchain_openai *
using create_react_agent, bind 2 tools.
bug in generate_from_stream



### Error Message and Stack Trace (if applicable)

_No response_

### Description

from langchain_openai *
using create_react_agent, bind 2 tools.
bug in generate_from_stream

When the model invokes the second tool, the following response will be returned:

![Image](https://github.com/user-attachments/assets/23caf49e-ecff-4c71-aa6a-329baf83e03b)

The initially appearing tool call index will show 1, and subsequent ones will show 0.

Finally, when `generate_from_stream` is used in `langchain_core.language_models.chat_models`'s `_generate_with_cache`, two erroneous tool calls are generated, whereas there is actually only one tool call.

![Image](https://github.com/user-attachments/assets/0ba7cd97-76a5-4c2b-8acf-86b25a15bc1a)


The model is deployed using Qwen3 and provides an OpenAI interface.

### System Info

    "httpx>=0.28.1",
    "langchain-community>=0.3.19",
    "langchain-experimental>=0.3.4",
    "langchain-openai>=0.3.8",
    "langgraph>=0.3.5",
    "readabilipy>=0.3.0",
    "python-dotenv>=1.0.1",
    "socksio>=1.0.0",
    "markdownify>=1.1.0",
    "fastapi>=0.110.0",
    "uvicorn>=0.27.1",
    "sse-starlette>=1.6.5",
    "pandas>=2.2.3",
    "numpy>=2.2.3",
    "yfinance>=0.2.54",
    "litellm>=1.63.11",
    "json-repair>=0.7.0",
    "jinja2>=3.1.3",
    "duckduckgo-search>=8.0.0",
    "inquirerpy>=0.3.4",
    "arxiv>=2.2.0",
    "mcp>=1.6.0",
    "langchain-mcp-adapters>=0.0.9",

Labels: bug
State: closed
[Bug]: Not understanding warning message from autogen during ConverseableAgent creation.

### Describe the bug

The following warning is issued by autogen during the ConverseableAgent creation even though the code functions as expected. 

Sample response from the two agent conversation relying upon a local function to return weather in order to determine tour suggestions.

[autogen.oai.client: 07-17 14:33:30] {164} WARNING - The API key specified is not a valid OpenAI format; it won't work with the OpenAI-hosted model.
user_proxy (to assistant2):
What are some interesting things to do while in Washington DC today?
--------------------------------------------------------------------------------
>>>>>>>> USING AUTO REPLY...
assistant2 (to user_proxy):
***** Suggested tool call (call_GZJyzpI9Rf9KtNvEEL0slu16): get_weather *****
Arguments:
{"location":"Washington DC"}

user_proxy (to assistant2):
***** Response from calling tool (call_GZJyzpI9Rf9KtNvEEL0slu16) *****
Heavy percipitation is expected throughout the day in Washington DC. T-Storms are very possible.
**********************************************************************
--------------------------------------------------------------------------------
>>>>>>>> USING AUTO REPLY...
assistant2 (to user_proxy):

Here are five suggested indoor activities to enjoy in Washington DC due to the heavy precipitation and possible thunderstorms:
1. Visit the Smithsonian museums.
2. Explore the National Gallery of Art.
3. Tour the U.S. Capitol Visitor Center.
4. Discover the Library of Congress.
5. Experience the International Spy Museum.

Feel free to let me know if you need more recommendations or information!

### Steps to reproduce

The llm_config contains the model and api_key in this format:
    model = os.getenv('OPENAI_MODEL')
    api_key = os.getenv('OPENAI_API_KEY')
    config_list = [
                    {
                     "model": model,
                     "api_key": api_key,
                    }
                   ]
    llm_config = { "config_list": config_list}

 assistant2 = ConversableAgent(
        name="assistant2",
        system_message="""You are a helpful tour guide assistant that can recommend points of interest based upon 
        ......
        Return 'TERMINATE' when the task is done.""",
        llm_config=llm_config,
    )
    print(assistant2.print_usage_summary)
    print(assistant2.llm_config) 

### Model Used

gpt-3.5-turbo

### Expected Behavior

The behavior is correct, I can't figure out how to clear the warning.

### Screenshots and logs

_No response_

### Additional Information

AutoGen Version: 0.2.32
Operating System: macOS Montery 12.6.2
Python Version: 3.12.4

State: closed