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

[Android] Session serialization uses base type instead of child for ConversationFunctionTool #310

Open
maratoss opened this issue Dec 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@maratoss
Copy link

Service

OpenAI

Describe the bug

Hi! Could you help me with the problem.

Smth wrong with serialization:
It sends request with wrong session's json
instead of using ConversationFunctionTool it uses base class ConversationTool
the session:
image

the serialized session:

{
	"session": {
		"instructions": "*hidden*",
		"voice": "alloy",
		"input_audio_format": "pcm16",
		"output_audio_format": "pcm16",
		"input_audio_transcription": {
			"model": "whisper-1"
		},
		"tools": [
			{
				"type": "function"
			},
			{
				"type": "function"
			},
			{
				"type": "function"
			},
			{
				"type": "function"
			},
			{
				"type": "function"
			},
			{
				"type": "function"
			},
			{
				"type": "function"
			},
			{
				"type": "function"
			},
			{
				"type": "function"
			},
			{
				"type": "function"
			},
			{
				"type": "function"
			}
		],
		"tool_choice": "auto"
	},
	"type": "session.update"
}

the following changes in ConversationSessionOptions.Serialization.cs fix the problem:
image

Steps to reproduce

  1. Need to create maui android project
  2. Create a session with Tools and Functions
  3. Configure the session
  4. it should send a corrected json

Code snippets

No response

OS

Android

.NET version

net8.0-android

Library version

2.1.0-beta.2

@maratoss maratoss added the bug Something isn't working label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant