Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions src/libs/tryAGI.OpenAI.CLI/GeneratedApi/CliRuntime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ internal static class CliRuntime
? new global::System.Collections.Generic.List<global::tryAGI.OpenAI.EndPointAuthorization>()
: new global::System.Collections.Generic.List<global::tryAGI.OpenAI.EndPointAuthorization>
{
new global::tryAGI.OpenAI.EndPointAuthorization
{
Type = "Http",
SchemeId = "ApiKeyAuth",
Location = "Header",
Name = "Bearer",
Value = apiKey,
},
CreateAuthorization(
type: "Http",
schemeId: "ApiKeyAuth",
location: "Header",
name: "Bearer",
value: apiKey),
};
var baseUri = ResolveBaseUri(parseResult);

Expand All @@ -42,6 +40,30 @@ internal static class CliRuntime
disposeHttpClient: true);
}

private static global::tryAGI.OpenAI.EndPointAuthorization CreateAuthorization(
string type,
string schemeId,
string location,
string name,
string value)
{
var authorization = new global::tryAGI.OpenAI.EndPointAuthorization
{
Type = type,
Location = location,
Name = name,
Value = value,
};

var schemeIdProperty = typeof(global::tryAGI.OpenAI.EndPointAuthorization).GetProperty("SchemeId");
if (schemeIdProperty?.CanWrite == true)
{
schemeIdProperty.SetValue(authorization, schemeId);
}

return authorization;
}

[System.Diagnostics.CodeAnalysis.SuppressMessage(
"Design",
"CA1031:Do not catch general exception types",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public class ToolJsonConverter : global::System.Text.Json.Serialization.JsonConv
if (__jsonProps.Contains("server_description")) __score5++;
if (__jsonProps.Contains("server_label")) __score5++;
if (__jsonProps.Contains("server_url")) __score5++;
if (__jsonProps.Contains("tunnel_id")) __score5++;
if (__jsonProps.Contains("type")) __score5++;
var __score6 = 0;
if (__jsonProps.Contains("container")) __score6++;
Expand Down
29 changes: 21 additions & 8 deletions src/libs/tryAGI.OpenAI/Generated/tryAGI.OpenAI.Models.MCPTool.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ public sealed partial class MCPTool
public required string ServerLabel { get; set; }

/// <summary>
/// The URL for the MCP server. One of `server_url` or `connector_id` must be<br/>
/// provided.
/// The URL for the MCP server. One of `server_url`, `connector_id`, or<br/>
/// `tunnel_id` must be provided.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("server_url")]
public string? ServerUrl { get; set; }

/// <summary>
/// Identifier for service connectors, like those available in ChatGPT. One of<br/>
/// `server_url` or `connector_id` must be provided. Learn more about service<br/>
/// connectors [here](/docs/guides/tools-remote-mcp#connectors).<br/>
/// `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more<br/>
/// about service connectors [here](/docs/guides/tools-remote-mcp#connectors).<br/>
/// Currently supported `connector_id` values are:<br/>
/// - Dropbox: `connector_dropbox`<br/>
/// - Gmail: `connector_gmail`<br/>
Expand All @@ -48,6 +48,13 @@ public sealed partial class MCPTool
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::tryAGI.OpenAI.JsonConverters.MCPToolConnectorIdJsonConverter))]
public global::tryAGI.OpenAI.MCPToolConnectorId? ConnectorId { get; set; }

/// <summary>
/// The Secure MCP Tunnel ID to use instead of a direct server URL. One of<br/>
/// `server_url`, `connector_id`, or `tunnel_id` must be provided.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("tunnel_id")]
public string? TunnelId { get; set; }

/// <summary>
/// An OAuth access token that can be used with a remote MCP server, either<br/>
/// with a custom MCP server URL or a service connector. Your application<br/>
Expand Down Expand Up @@ -102,13 +109,13 @@ public sealed partial class MCPTool
/// The type of the MCP tool. Always `mcp`.
/// </param>
/// <param name="serverUrl">
/// The URL for the MCP server. One of `server_url` or `connector_id` must be<br/>
/// provided.
/// The URL for the MCP server. One of `server_url`, `connector_id`, or<br/>
/// `tunnel_id` must be provided.
/// </param>
/// <param name="connectorId">
/// Identifier for service connectors, like those available in ChatGPT. One of<br/>
/// `server_url` or `connector_id` must be provided. Learn more about service<br/>
/// connectors [here](/docs/guides/tools-remote-mcp#connectors).<br/>
/// `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more<br/>
/// about service connectors [here](/docs/guides/tools-remote-mcp#connectors).<br/>
/// Currently supported `connector_id` values are:<br/>
/// - Dropbox: `connector_dropbox`<br/>
/// - Gmail: `connector_gmail`<br/>
Expand All @@ -119,6 +126,10 @@ public sealed partial class MCPTool
/// - Outlook Email: `connector_outlookemail`<br/>
/// - SharePoint: `connector_sharepoint`
/// </param>
/// <param name="tunnelId">
/// The Secure MCP Tunnel ID to use instead of a direct server URL. One of<br/>
/// `server_url`, `connector_id`, or `tunnel_id` must be provided.
/// </param>
/// <param name="authorization">
/// An OAuth access token that can be used with a remote MCP server, either<br/>
/// with a custom MCP server URL or a service connector. Your application<br/>
Expand All @@ -141,6 +152,7 @@ public MCPTool(
global::tryAGI.OpenAI.MCPToolType type,
string? serverUrl,
global::tryAGI.OpenAI.MCPToolConnectorId? connectorId,
string? tunnelId,
string? authorization,
string? serverDescription,
global::System.Collections.Generic.Dictionary<string, string>? headers,
Expand All @@ -152,6 +164,7 @@ public MCPTool(
this.ServerLabel = serverLabel ?? throw new global::System.ArgumentNullException(nameof(serverLabel));
this.ServerUrl = serverUrl;
this.ConnectorId = connectorId;
this.TunnelId = tunnelId;
this.Authorization = authorization;
this.ServerDescription = serverDescription;
this.Headers = headers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace tryAGI.OpenAI
{
/// <summary>
/// Identifier for service connectors, like those available in ChatGPT. One of<br/>
/// `server_url` or `connector_id` must be provided. Learn more about service<br/>
/// connectors [here](/docs/guides/tools-remote-mcp#connectors).<br/>
/// `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more<br/>
/// about service connectors [here](/docs/guides/tools-remote-mcp#connectors).<br/>
/// Currently supported `connector_id` values are:<br/>
/// - Dropbox: `connector_dropbox`<br/>
/// - Gmail: `connector_gmail`<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ public sealed partial class MCPTool
public required string ServerLabel { get; set; }

/// <summary>
/// The URL for the MCP server. One of `server_url` or `connector_id` must be<br/>
/// provided.
/// The URL for the MCP server. One of `server_url`, `connector_id`, or<br/>
/// `tunnel_id` must be provided.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("server_url")]
public string? ServerUrl { get; set; }

/// <summary>
/// Identifier for service connectors, like those available in ChatGPT. One of<br/>
/// `server_url` or `connector_id` must be provided. Learn more about service<br/>
/// connectors [here](/docs/guides/tools-remote-mcp#connectors).<br/>
/// `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more<br/>
/// about service connectors [here](/docs/guides/tools-remote-mcp#connectors).<br/>
/// Currently supported `connector_id` values are:<br/>
/// - Dropbox: `connector_dropbox`<br/>
/// - Gmail: `connector_gmail`<br/>
Expand All @@ -48,6 +48,13 @@ public sealed partial class MCPTool
[global::System.Text.Json.Serialization.JsonConverter(typeof(global::tryAGI.OpenAI.Realtime.JsonConverters.MCPToolConnectorIdJsonConverter))]
public global::tryAGI.OpenAI.Realtime.MCPToolConnectorId? ConnectorId { get; set; }

/// <summary>
/// The Secure MCP Tunnel ID to use instead of a direct server URL. One of<br/>
/// `server_url`, `connector_id`, or `tunnel_id` must be provided.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("tunnel_id")]
public string? TunnelId { get; set; }

/// <summary>
/// An OAuth access token that can be used with a remote MCP server, either<br/>
/// with a custom MCP server URL or a service connector. Your application<br/>
Expand Down Expand Up @@ -102,13 +109,13 @@ public sealed partial class MCPTool
/// The type of the MCP tool. Always `mcp`.
/// </param>
/// <param name="serverUrl">
/// The URL for the MCP server. One of `server_url` or `connector_id` must be<br/>
/// provided.
/// The URL for the MCP server. One of `server_url`, `connector_id`, or<br/>
/// `tunnel_id` must be provided.
/// </param>
/// <param name="connectorId">
/// Identifier for service connectors, like those available in ChatGPT. One of<br/>
/// `server_url` or `connector_id` must be provided. Learn more about service<br/>
/// connectors [here](/docs/guides/tools-remote-mcp#connectors).<br/>
/// `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more<br/>
/// about service connectors [here](/docs/guides/tools-remote-mcp#connectors).<br/>
/// Currently supported `connector_id` values are:<br/>
/// - Dropbox: `connector_dropbox`<br/>
/// - Gmail: `connector_gmail`<br/>
Expand All @@ -119,6 +126,10 @@ public sealed partial class MCPTool
/// - Outlook Email: `connector_outlookemail`<br/>
/// - SharePoint: `connector_sharepoint`
/// </param>
/// <param name="tunnelId">
/// The Secure MCP Tunnel ID to use instead of a direct server URL. One of<br/>
/// `server_url`, `connector_id`, or `tunnel_id` must be provided.
/// </param>
/// <param name="authorization">
/// An OAuth access token that can be used with a remote MCP server, either<br/>
/// with a custom MCP server URL or a service connector. Your application<br/>
Expand All @@ -141,6 +152,7 @@ public MCPTool(
global::tryAGI.OpenAI.Realtime.MCPToolType type,
string? serverUrl,
global::tryAGI.OpenAI.Realtime.MCPToolConnectorId? connectorId,
string? tunnelId,
string? authorization,
string? serverDescription,
global::System.Collections.Generic.Dictionary<string, string>? headers,
Expand All @@ -152,6 +164,7 @@ public MCPTool(
this.ServerLabel = serverLabel ?? throw new global::System.ArgumentNullException(nameof(serverLabel));
this.ServerUrl = serverUrl;
this.ConnectorId = connectorId;
this.TunnelId = tunnelId;
this.Authorization = authorization;
this.ServerDescription = serverDescription;
this.Headers = headers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace tryAGI.OpenAI.Realtime
{
/// <summary>
/// Identifier for service connectors, like those available in ChatGPT. One of<br/>
/// `server_url` or `connector_id` must be provided. Learn more about service<br/>
/// connectors [here](/docs/guides/tools-remote-mcp#connectors).<br/>
/// `server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more<br/>
/// about service connectors [here](/docs/guides/tools-remote-mcp#connectors).<br/>
/// Currently supported `connector_id` values are:<br/>
/// - Dropbox: `connector_dropbox`<br/>
/// - Gmail: `connector_gmail`<br/>
Expand Down
9 changes: 7 additions & 2 deletions src/libs/tryAGI.OpenAI/asyncapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1592,7 +1592,7 @@
"server_url": {
"type": "string",
"format": "uri",
"description": "The URL for the MCP server. One of `server_url` or `connector_id` must be\nprovided.\n"
"description": "The URL for the MCP server. One of `server_url`, `connector_id`, or\n`tunnel_id` must be provided.\n"
},
"connector_id": {
"type": "string",
Expand All @@ -1606,7 +1606,12 @@
"connector_outlookemail",
"connector_sharepoint"
],
"description": "Identifier for service connectors, like those available in ChatGPT. One of\n`server_url` or `connector_id` must be provided. Learn more about service\nconnectors [here](/docs/guides/tools-remote-mcp#connectors).\n\nCurrently supported `connector_id` values are:\n\n- Dropbox: `connector_dropbox`\n- Gmail: `connector_gmail`\n- Google Calendar: `connector_googlecalendar`\n- Google Drive: `connector_googledrive`\n- Microsoft Teams: `connector_microsoftteams`\n- Outlook Calendar: `connector_outlookcalendar`\n- Outlook Email: `connector_outlookemail`\n- SharePoint: `connector_sharepoint`\n"
"description": "Identifier for service connectors, like those available in ChatGPT. One of\n`server_url`, `connector_id`, or `tunnel_id` must be provided. Learn more\nabout service connectors [here](/docs/guides/tools-remote-mcp#connectors).\n\nCurrently supported `connector_id` values are:\n\n- Dropbox: `connector_dropbox`\n- Gmail: `connector_gmail`\n- Google Calendar: `connector_googlecalendar`\n- Google Drive: `connector_googledrive`\n- Microsoft Teams: `connector_microsoftteams`\n- Outlook Calendar: `connector_outlookcalendar`\n- Outlook Email: `connector_outlookemail`\n- SharePoint: `connector_sharepoint`\n"
},
"tunnel_id": {
"type": "string",
"pattern": "^tunnel_[a-z0-9]{32}$",
"description": "The Secure MCP Tunnel ID to use instead of a direct server URL. One of\n`server_url`, `connector_id`, or `tunnel_id` must be provided.\n"
},
"authorization": {
"type": "string",
Expand Down
29 changes: 21 additions & 8 deletions src/libs/tryAGI.OpenAI/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57377,11 +57377,9 @@ components:
server_url:
type: string
format: uri
description: >
The URL for the MCP server. One of `server_url` or `connector_id`
must be

provided.
description: |
The URL for the MCP server. One of `server_url`, `connector_id`, or
`tunnel_id` must be provided.
connector_id:
type: string
enum:
Expand All @@ -57397,10 +57395,11 @@ components:
Identifier for service connectors, like those available in ChatGPT.
One of

`server_url` or `connector_id` must be provided. Learn more about
service
`server_url`, `connector_id`, or `tunnel_id` must be provided. Learn
more

connectors [here](/docs/guides/tools-remote-mcp#connectors).
about service connectors
[here](/docs/guides/tools-remote-mcp#connectors).


Currently supported `connector_id` values are:
Expand All @@ -57421,6 +57420,14 @@ components:
- Outlook Email: `connector_outlookemail`

- SharePoint: `connector_sharepoint`
tunnel_id:
type: string
pattern: ^tunnel_[a-z0-9]{32}$
description: >
The Secure MCP Tunnel ID to use instead of a direct server URL. One
of

`server_url`, `connector_id`, or `tunnel_id` must be provided.
authorization:
type: string
description: >
Expand Down Expand Up @@ -83779,6 +83786,10 @@ components:
Optional reference asset upload or reference object that guides
generation.
- $ref: '#/components/schemas/ImageRefParam-2'
description: >-
Optional reference asset upload or reference object that guides
generation. Provide exactly one of `image_url` or `file_id` when
using an object.
seconds:
$ref: '#/components/schemas/VideoSeconds'
description: >-
Expand Down Expand Up @@ -83882,6 +83893,7 @@ components:
format: binary
description: Reference to the completed video to edit.
- $ref: '#/components/schemas/VideoReferenceInputParam'
description: Reference to the completed video to edit.
prompt:
type: string
maxLength: 32000
Expand Down Expand Up @@ -83914,6 +83926,7 @@ components:
video:
oneOf:
- $ref: '#/components/schemas/VideoReferenceInputParam'
description: Reference to the completed video to extend.
- type: string
format: binary
description: Reference to the completed video to extend.
Expand Down