agent-framework-github-copilot 1.0.0rc3__tar.gz → 1.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agent_framework_github_copilot-1.0.0rc3 → agent_framework_github_copilot-1.0.1}/PKG-INFO +4 -4
- {agent_framework_github_copilot-1.0.0rc3 → agent_framework_github_copilot-1.0.1}/README.md +1 -1
- {agent_framework_github_copilot-1.0.0rc3 → agent_framework_github_copilot-1.0.1}/agent_framework_github_copilot/_agent.py +165 -87
- agent_framework_github_copilot-1.0.1/agent_framework_github_copilot/_feature_usage.py +9 -0
- {agent_framework_github_copilot-1.0.0rc3 → agent_framework_github_copilot-1.0.1}/pyproject.toml +3 -3
- {agent_framework_github_copilot-1.0.0rc3 → agent_framework_github_copilot-1.0.1}/LICENSE +0 -0
- {agent_framework_github_copilot-1.0.0rc3 → agent_framework_github_copilot-1.0.1}/agent_framework_github_copilot/__init__.py +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agent-framework-github-copilot
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.1
|
|
4
4
|
Summary: GitHub Copilot integration for Microsoft Agent Framework.
|
|
5
5
|
Author-email: Microsoft <af-support@microsoft.com>
|
|
6
6
|
Requires-Python: >=3.10
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
-
Classifier: Development Status ::
|
|
9
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
10
10
|
Classifier: Intended Audience :: Developers
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.14
|
|
17
17
|
Classifier: Typing :: Typed
|
|
18
18
|
License-File: LICENSE
|
|
19
|
-
Requires-Dist: agent-framework-core>=1.
|
|
19
|
+
Requires-Dist: agent-framework-core>=1.13.0,<2
|
|
20
20
|
Requires-Dist: github-copilot-sdk==1.0.2; python_version >= '3.11'
|
|
21
21
|
Project-URL: homepage, https://aka.ms/agent-framework
|
|
22
22
|
Project-URL: issues, https://github.com/microsoft/agent-framework/issues
|
|
@@ -28,7 +28,7 @@ Project-URL: source, https://github.com/microsoft/agent-framework/tree/main/pyth
|
|
|
28
28
|
Please install this package via pip:
|
|
29
29
|
|
|
30
30
|
```bash
|
|
31
|
-
pip install agent-framework-github-copilot
|
|
31
|
+
pip install agent-framework-github-copilot
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
## GitHub Copilot Agent
|
|
@@ -29,11 +29,18 @@ from agent_framework import (
|
|
|
29
29
|
normalize_messages,
|
|
30
30
|
)
|
|
31
31
|
from agent_framework._settings import load_settings
|
|
32
|
+
from agent_framework._telemetry import mark_feature_used
|
|
32
33
|
from agent_framework._tools import FunctionTool, ToolTypes
|
|
33
|
-
from agent_framework._types import
|
|
34
|
-
|
|
34
|
+
from agent_framework._types import (
|
|
35
|
+
AgentRunInputs,
|
|
36
|
+
_get_data_bytes_as_str, # pyright: ignore[reportPrivateUsage]
|
|
37
|
+
normalize_tools,
|
|
38
|
+
)
|
|
39
|
+
from agent_framework.exceptions import AgentException, ContentError
|
|
35
40
|
from agent_framework.observability import AgentTelemetryLayer
|
|
36
41
|
|
|
42
|
+
from ._feature_usage import FeatureIndex
|
|
43
|
+
|
|
37
44
|
if sys.version_info >= (3, 11):
|
|
38
45
|
from typing import Self # pragma: no cover
|
|
39
46
|
else:
|
|
@@ -47,6 +54,8 @@ try:
|
|
|
47
54
|
from copilot import CopilotClient, CopilotSession, RuntimeConnection
|
|
48
55
|
from copilot.generated.rpc import PermissionDecisionUserNotAvailable
|
|
49
56
|
from copilot.session import (
|
|
57
|
+
Attachment,
|
|
58
|
+
BlobAttachment,
|
|
50
59
|
MCPServerConfig,
|
|
51
60
|
PermissionRequestResult,
|
|
52
61
|
PreToolUseHandler,
|
|
@@ -162,7 +171,16 @@ class GitHubCopilotSettings(TypedDict, total=False):
|
|
|
162
171
|
|
|
163
172
|
|
|
164
173
|
class GitHubCopilotOptions(TypedDict, total=False):
|
|
165
|
-
"""GitHub Copilot-specific options.
|
|
174
|
+
"""GitHub Copilot-specific options.
|
|
175
|
+
|
|
176
|
+
The keys below have first-class typing and inline documentation because they are
|
|
177
|
+
the commonly used options. They are **not** an exhaustive list: any other
|
|
178
|
+
parameter accepted by the Copilot SDK's ``create_session`` (for example
|
|
179
|
+
``reasoning_effort``, ``context_tier``, ``enable_citations``, ``available_tools``,
|
|
180
|
+
``memory``, ...) may also be supplied and is forwarded verbatim to the SDK. An
|
|
181
|
+
unrecognized parameter name surfaces as a ``TypeError`` from the SDK, so typos are
|
|
182
|
+
caught rather than silently ignored.
|
|
183
|
+
"""
|
|
166
184
|
|
|
167
185
|
system_message: SystemMessageConfig
|
|
168
186
|
"""System message configuration for the session. Use mode 'append' to add to the default
|
|
@@ -355,11 +373,6 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
355
373
|
timeout = opts.pop("timeout", None)
|
|
356
374
|
log_level = opts.pop("log_level", None)
|
|
357
375
|
on_permission_request: PermissionHandlerType | None = opts.pop("on_permission_request", None)
|
|
358
|
-
mcp_servers: dict[str, MCPServerConfig] | None = opts.pop("mcp_servers", None)
|
|
359
|
-
provider: ProviderConfig | None = opts.pop("provider", None)
|
|
360
|
-
instruction_directories: list[str] | None = opts.pop("instruction_directories", None)
|
|
361
|
-
skill_directories: list[str] | None = opts.pop("skill_directories", None)
|
|
362
|
-
disabled_skills: list[str] | None = opts.pop("disabled_skills", None)
|
|
363
376
|
on_pre_tool_use: PreToolUseHandler | None = opts.pop("on_pre_tool_use", None)
|
|
364
377
|
on_function_approval: FunctionApprovalCallback | None = opts.pop("on_function_approval", None)
|
|
365
378
|
base_directory = opts.pop("base_directory", None)
|
|
@@ -397,11 +410,9 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
397
410
|
self._permission_handler = on_permission_request
|
|
398
411
|
self._on_pre_tool_use: PreToolUseHandler | None = on_pre_tool_use
|
|
399
412
|
self._function_approval_handler: FunctionApprovalCallback | None = on_function_approval
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
self._skill_directories = skill_directories
|
|
404
|
-
self._disabled_skills = disabled_skills
|
|
413
|
+
# Remaining options (e.g. mcp_servers, provider, instruction_directories,
|
|
414
|
+
# skill_directories, disabled_skills, and any other create_session parameter)
|
|
415
|
+
# are forwarded verbatim to the Copilot SDK by _build_session_kwargs.
|
|
405
416
|
self._default_options = opts
|
|
406
417
|
self._started = False
|
|
407
418
|
|
|
@@ -635,8 +646,11 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
635
646
|
parsed_usage_details = self._parse_usage_details_from_copilot(event.data)
|
|
636
647
|
if parsed_usage_details:
|
|
637
648
|
usage_details = add_usage_details(usage_details, parsed_usage_details)
|
|
638
|
-
|
|
639
|
-
|
|
649
|
+
event_finish_reason = (
|
|
650
|
+
"content_filter" if event.data.content_filter_triggered else event.data.finish_reason
|
|
651
|
+
)
|
|
652
|
+
if event_finish_reason:
|
|
653
|
+
finish_reason = event_finish_reason
|
|
640
654
|
if event.data.model:
|
|
641
655
|
model = event.data.model
|
|
642
656
|
else:
|
|
@@ -651,10 +665,12 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
651
665
|
prompt = "\n".join([message.text for message in context_messages])
|
|
652
666
|
if session_context.instructions:
|
|
653
667
|
prompt = "\n".join(session_context.instructions) + "\n" + prompt
|
|
668
|
+
attachments = self._prepare_attachments_for_copilot(context_messages)
|
|
654
669
|
|
|
655
670
|
unsubscribe = copilot_session.on(usage_event_handler)
|
|
656
671
|
try:
|
|
657
|
-
|
|
672
|
+
mark_feature_used(FeatureIndex.GITHUB_COPILOT)
|
|
673
|
+
response_event = await copilot_session.send_and_wait(prompt, attachments=attachments, timeout=timeout)
|
|
658
674
|
except Exception as ex:
|
|
659
675
|
raise AgentException(f"GitHub Copilot request failed: {ex}") from ex
|
|
660
676
|
finally:
|
|
@@ -757,6 +773,7 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
757
773
|
prompt = "\n".join([message.text for message in context_messages])
|
|
758
774
|
if session_context.instructions:
|
|
759
775
|
prompt = "\n".join(session_context.instructions) + "\n" + prompt
|
|
776
|
+
attachments = self._prepare_attachments_for_copilot(context_messages)
|
|
760
777
|
|
|
761
778
|
queue: asyncio.Queue[AgentResponseUpdate | Exception | None] = asyncio.Queue()
|
|
762
779
|
|
|
@@ -780,7 +797,7 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
780
797
|
)
|
|
781
798
|
return
|
|
782
799
|
usage_details = self._parse_usage_details_from_copilot(event.data)
|
|
783
|
-
finish_reason = event.data.
|
|
800
|
+
finish_reason = "content_filter" if event.data.content_filter_triggered else event.data.finish_reason
|
|
784
801
|
model = event.data.model or None
|
|
785
802
|
if usage_details or finish_reason or model:
|
|
786
803
|
update = AgentResponseUpdate(
|
|
@@ -839,7 +856,8 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
839
856
|
unsubscribe = copilot_session.on(event_handler)
|
|
840
857
|
|
|
841
858
|
try:
|
|
842
|
-
|
|
859
|
+
mark_feature_used(FeatureIndex.GITHUB_COPILOT)
|
|
860
|
+
await copilot_session.send(prompt, attachments=attachments)
|
|
843
861
|
|
|
844
862
|
while (item := await queue.get()) is not None:
|
|
845
863
|
if isinstance(item, Exception):
|
|
@@ -911,6 +929,56 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
911
929
|
elif opts_system_message is not None:
|
|
912
930
|
opts["system_message"] = opts_system_message
|
|
913
931
|
|
|
932
|
+
@staticmethod
|
|
933
|
+
def _prepare_attachments_for_copilot(messages: Sequence[Message]) -> list[Attachment] | None:
|
|
934
|
+
"""Convert inline binary message content into Copilot SDK attachments.
|
|
935
|
+
|
|
936
|
+
Scans the outgoing messages for ``data`` content (binary payloads such as
|
|
937
|
+
images or documents carried as base64 data URIs) and maps each one to an
|
|
938
|
+
inline ``blob`` attachment understood by the Copilot SDK.
|
|
939
|
+
|
|
940
|
+
Only base64 ``data:`` content is forwarded as an attachment. Other content
|
|
941
|
+
is not turned into an attachment: text content is already carried in the
|
|
942
|
+
prompt, while remote URIs (for example ``https://`` links) and malformed or
|
|
943
|
+
non-base64 ``data:`` URIs are skipped -- they are neither attached nor added
|
|
944
|
+
to the prompt.
|
|
945
|
+
|
|
946
|
+
Args:
|
|
947
|
+
messages: The messages being sent to the Copilot session.
|
|
948
|
+
|
|
949
|
+
Returns:
|
|
950
|
+
A list of Copilot ``Attachment`` objects, or ``None`` when the messages
|
|
951
|
+
contain no attachable binary content.
|
|
952
|
+
"""
|
|
953
|
+
attachments: list[Attachment] = []
|
|
954
|
+
for message in messages:
|
|
955
|
+
for content in message.contents:
|
|
956
|
+
if content.type != "data":
|
|
957
|
+
continue
|
|
958
|
+
try:
|
|
959
|
+
data_str = _get_data_bytes_as_str(content)
|
|
960
|
+
except ContentError:
|
|
961
|
+
logger.warning(
|
|
962
|
+
"Skipping GitHub Copilot attachment with an unsupported data URI; "
|
|
963
|
+
"only base64-encoded 'data:' URIs can be forwarded as attachments."
|
|
964
|
+
)
|
|
965
|
+
continue
|
|
966
|
+
if not data_str:
|
|
967
|
+
continue
|
|
968
|
+
if not content.media_type:
|
|
969
|
+
logger.warning(
|
|
970
|
+
"Dropping GitHub Copilot attachment with no media type; the Copilot SDK "
|
|
971
|
+
"requires a MIME type for inline binary content."
|
|
972
|
+
)
|
|
973
|
+
continue
|
|
974
|
+
blob: BlobAttachment = {
|
|
975
|
+
"type": "blob",
|
|
976
|
+
"data": data_str,
|
|
977
|
+
"mimeType": content.media_type,
|
|
978
|
+
}
|
|
979
|
+
attachments.append(blob)
|
|
980
|
+
return attachments or None
|
|
981
|
+
|
|
914
982
|
def _prepare_tools(
|
|
915
983
|
self,
|
|
916
984
|
tools: Sequence[ToolTypes | CopilotTool],
|
|
@@ -999,7 +1067,7 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
999
1067
|
def _build_session_hooks(
|
|
1000
1068
|
self,
|
|
1001
1069
|
all_tools: Sequence[ToolTypes | CopilotTool],
|
|
1002
|
-
|
|
1070
|
+
options: Mapping[str, Any],
|
|
1003
1071
|
) -> SessionHooks | None:
|
|
1004
1072
|
"""Build the ``SessionHooks`` to pass to the Copilot SDK for this session.
|
|
1005
1073
|
|
|
@@ -1007,11 +1075,14 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
1007
1075
|
``approval_mode="always_require"`` is delegated to the Copilot SDK's native
|
|
1008
1076
|
``on_pre_tool_use`` hook:
|
|
1009
1077
|
|
|
1010
|
-
- If the caller supplies their own
|
|
1011
|
-
|
|
1078
|
+
- If the caller supplies their own session hooks -- either the SDK-native
|
|
1079
|
+
``hooks`` dict or the convenience ``on_pre_tool_use`` handler (via per-run
|
|
1080
|
+
``options`` or ``default_options``) -- those take precedence and are used
|
|
1081
|
+
as-is. When both are given, the explicit ``hooks`` dict wins for any key it
|
|
1082
|
+
defines and the ``on_pre_tool_use`` shortcut fills in that key otherwise. A
|
|
1012
1083
|
warning is logged naming any approval-required tool that will therefore not
|
|
1013
|
-
be automatically gated, since the caller's
|
|
1014
|
-
approval.
|
|
1084
|
+
be automatically gated, since the caller's hooks are responsible for
|
|
1085
|
+
enforcing approval.
|
|
1015
1086
|
- Otherwise, when any approval-required tool is present, a default hook is
|
|
1016
1087
|
installed that returns ``"ask"`` for those tools (routing the decision to
|
|
1017
1088
|
``on_permission_request``) and defers (``None``) for all other tools.
|
|
@@ -1019,32 +1090,43 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
1019
1090
|
``on_function_approval`` callback is configured: in that case approval is
|
|
1020
1091
|
enforced inside the tool handler (see :meth:`_tool_to_copilot_tool`) to
|
|
1021
1092
|
preserve backward-compatible behavior.
|
|
1022
|
-
- When there are no approval-required tools and no caller
|
|
1093
|
+
- When there are no approval-required tools and no caller hooks, ``None`` is
|
|
1023
1094
|
returned so no hooks are registered.
|
|
1024
1095
|
|
|
1025
1096
|
Args:
|
|
1026
1097
|
all_tools: The full set of tools resolved for the session.
|
|
1027
|
-
|
|
1098
|
+
options: The merged session options (``default_options`` overlaid with
|
|
1099
|
+
per-run ``options``).
|
|
1028
1100
|
|
|
1029
1101
|
Returns:
|
|
1030
1102
|
The hooks to register for the session, or ``None`` if none are needed.
|
|
1031
1103
|
"""
|
|
1032
|
-
user_hook: PreToolUseHandler | None =
|
|
1104
|
+
user_hook: PreToolUseHandler | None = options.get("on_pre_tool_use") or self._on_pre_tool_use
|
|
1105
|
+
caller_hooks: Mapping[str, Any] | None = options.get("hooks")
|
|
1106
|
+
|
|
1107
|
+
# Combine caller-provided hooks: the SDK-native ``hooks`` dict plus the
|
|
1108
|
+
# convenience ``on_pre_tool_use`` shortcut. The explicit dict wins for the
|
|
1109
|
+
# keys it defines; the shortcut only fills in ``on_pre_tool_use`` otherwise.
|
|
1110
|
+
combined: dict[str, Any] = {}
|
|
1111
|
+
if user_hook is not None:
|
|
1112
|
+
combined["on_pre_tool_use"] = user_hook
|
|
1113
|
+
if caller_hooks:
|
|
1114
|
+
combined.update(caller_hooks)
|
|
1033
1115
|
|
|
1034
1116
|
approval_required_names = {
|
|
1035
1117
|
tool.name for tool in all_tools if isinstance(tool, FunctionTool) and tool.approval_mode == "always_require"
|
|
1036
1118
|
}
|
|
1037
1119
|
|
|
1038
|
-
if
|
|
1120
|
+
if combined:
|
|
1039
1121
|
if approval_required_names:
|
|
1040
1122
|
logger.warning(
|
|
1041
|
-
"
|
|
1042
|
-
"will not be automatically gated by GitHubCopilotAgent. The custom
|
|
1123
|
+
"Custom session hooks are configured, so %d approval-required tool(s) (%s) "
|
|
1124
|
+
"will not be automatically gated by GitHubCopilotAgent. The custom hooks are responsible "
|
|
1043
1125
|
"for enforcing approval (for example, by returning a 'deny' or 'ask' decision).",
|
|
1044
1126
|
len(approval_required_names),
|
|
1045
1127
|
", ".join(sorted(approval_required_names)),
|
|
1046
1128
|
)
|
|
1047
|
-
return
|
|
1129
|
+
return cast("SessionHooks", combined)
|
|
1048
1130
|
|
|
1049
1131
|
if not approval_required_names:
|
|
1050
1132
|
return None
|
|
@@ -1107,6 +1189,57 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
1107
1189
|
except Exception as ex:
|
|
1108
1190
|
raise AgentException(f"Failed to create GitHub Copilot session: {ex}") from ex
|
|
1109
1191
|
|
|
1192
|
+
def _build_session_kwargs(
|
|
1193
|
+
self,
|
|
1194
|
+
streaming: bool,
|
|
1195
|
+
runtime_options: dict[str, Any] | None,
|
|
1196
|
+
) -> dict[str, Any]:
|
|
1197
|
+
"""Assemble keyword arguments for ``create_session`` / ``resume_session``.
|
|
1198
|
+
|
|
1199
|
+
Options are layered: the agent's ``default_options`` first, then per-run
|
|
1200
|
+
``runtime_options`` which override them. Every key is forwarded verbatim to
|
|
1201
|
+
the Copilot SDK, so any ``create_session`` parameter is supported without a
|
|
1202
|
+
dedicated mapping here (an unknown name surfaces as a ``TypeError`` from the
|
|
1203
|
+
SDK). A few keys are handled specially because they need a secure default
|
|
1204
|
+
(``on_permission_request`` defaults to denying all requests) or transforming:
|
|
1205
|
+
``tools`` are merged with the agent's tools and converted to SDK tools, and
|
|
1206
|
+
approval callbacks are turned into ``hooks``.
|
|
1207
|
+
|
|
1208
|
+
Args:
|
|
1209
|
+
streaming: Whether to enable streaming for the session.
|
|
1210
|
+
runtime_options: Runtime options that take precedence over default_options.
|
|
1211
|
+
|
|
1212
|
+
Returns:
|
|
1213
|
+
The keyword arguments to splat into the SDK session factory.
|
|
1214
|
+
"""
|
|
1215
|
+
opts = runtime_options or {}
|
|
1216
|
+
|
|
1217
|
+
# Passthrough layer: agent defaults first, per-run options override.
|
|
1218
|
+
kwargs: dict[str, Any] = {**self._default_options, **opts}
|
|
1219
|
+
|
|
1220
|
+
# Merge agent-level tools with any caller-supplied tools (from default_options
|
|
1221
|
+
# or per-run options, the latter winning) and convert to SDK tools.
|
|
1222
|
+
all_tools = list(self._tools or []) + list(kwargs.get("tools") or [])
|
|
1223
|
+
kwargs["tools"] = self._prepare_tools(all_tools) if all_tools else None
|
|
1224
|
+
|
|
1225
|
+
kwargs["streaming"] = streaming
|
|
1226
|
+
# model may already be present from per-run options (merged above); otherwise fall
|
|
1227
|
+
# back to the resolved setting (which carries the default_options / env model).
|
|
1228
|
+
if not kwargs.get("model"):
|
|
1229
|
+
kwargs["model"] = self._settings.get("model") or None
|
|
1230
|
+
kwargs["on_permission_request"] = (
|
|
1231
|
+
opts.get("on_permission_request") or self._permission_handler or _deny_all_permissions
|
|
1232
|
+
)
|
|
1233
|
+
kwargs["hooks"] = self._build_session_hooks(all_tools, kwargs)
|
|
1234
|
+
|
|
1235
|
+
# Strip agent-internal and client-level keys that are consumed here or in the
|
|
1236
|
+
# run methods (and settings) but are NOT valid create_session parameters, so
|
|
1237
|
+
# they don't leak through the passthrough layer and raise TypeError.
|
|
1238
|
+
for key in ("on_pre_tool_use", "on_function_approval", "timeout", "cli_path", "log_level", "base_directory"):
|
|
1239
|
+
kwargs.pop(key, None)
|
|
1240
|
+
|
|
1241
|
+
return kwargs
|
|
1242
|
+
|
|
1110
1243
|
async def _create_session(
|
|
1111
1244
|
self,
|
|
1112
1245
|
streaming: bool,
|
|
@@ -1121,34 +1254,7 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
1121
1254
|
if not self._client:
|
|
1122
1255
|
raise RuntimeError("GitHub Copilot client not initialized. Call start() first.")
|
|
1123
1256
|
|
|
1124
|
-
|
|
1125
|
-
model = opts.get("model") or self._settings.get("model") or None
|
|
1126
|
-
system_message = opts.get("system_message") or self._default_options.get("system_message") or None
|
|
1127
|
-
permission_handler: PermissionHandlerType = (
|
|
1128
|
-
opts.get("on_permission_request") or self._permission_handler or _deny_all_permissions
|
|
1129
|
-
)
|
|
1130
|
-
mcp_servers = opts.get("mcp_servers") or self._mcp_servers or None
|
|
1131
|
-
provider = opts.get("provider") or self._provider or None
|
|
1132
|
-
instruction_directories = opts.get("instruction_directories", self._instruction_directories)
|
|
1133
|
-
skill_directories = opts.get("skill_directories", self._skill_directories)
|
|
1134
|
-
disabled_skills = opts.get("disabled_skills", self._disabled_skills)
|
|
1135
|
-
all_tools = list(self._tools or []) + list(opts.get("tools") or [])
|
|
1136
|
-
tools = self._prepare_tools(all_tools) if all_tools else None
|
|
1137
|
-
hooks = self._build_session_hooks(all_tools, opts)
|
|
1138
|
-
|
|
1139
|
-
return await self._client.create_session(
|
|
1140
|
-
on_permission_request=permission_handler,
|
|
1141
|
-
streaming=streaming,
|
|
1142
|
-
model=model or None,
|
|
1143
|
-
system_message=system_message or None,
|
|
1144
|
-
tools=tools or None,
|
|
1145
|
-
mcp_servers=mcp_servers or None,
|
|
1146
|
-
provider=provider or None,
|
|
1147
|
-
instruction_directories=instruction_directories,
|
|
1148
|
-
skill_directories=skill_directories,
|
|
1149
|
-
disabled_skills=disabled_skills,
|
|
1150
|
-
hooks=hooks,
|
|
1151
|
-
)
|
|
1257
|
+
return await self._client.create_session(**self._build_session_kwargs(streaming, runtime_options))
|
|
1152
1258
|
|
|
1153
1259
|
async def _resume_session(
|
|
1154
1260
|
self,
|
|
@@ -1166,35 +1272,7 @@ class RawGitHubCopilotAgent(BaseAgent, Generic[OptionsT]):
|
|
|
1166
1272
|
if not self._client:
|
|
1167
1273
|
raise RuntimeError("GitHub Copilot client not initialized. Call start() first.")
|
|
1168
1274
|
|
|
1169
|
-
|
|
1170
|
-
model = opts.get("model") or self._settings.get("model") or None
|
|
1171
|
-
system_message = opts.get("system_message") or self._default_options.get("system_message") or None
|
|
1172
|
-
permission_handler: PermissionHandlerType = (
|
|
1173
|
-
opts.get("on_permission_request") or self._permission_handler or _deny_all_permissions
|
|
1174
|
-
)
|
|
1175
|
-
mcp_servers = opts.get("mcp_servers") or self._mcp_servers or None
|
|
1176
|
-
provider = opts.get("provider") or self._provider or None
|
|
1177
|
-
instruction_directories = opts.get("instruction_directories", self._instruction_directories)
|
|
1178
|
-
skill_directories = opts.get("skill_directories", self._skill_directories)
|
|
1179
|
-
disabled_skills = opts.get("disabled_skills", self._disabled_skills)
|
|
1180
|
-
all_tools = list(self._tools or []) + list(opts.get("tools") or [])
|
|
1181
|
-
tools = self._prepare_tools(all_tools) if all_tools else None
|
|
1182
|
-
hooks = self._build_session_hooks(all_tools, opts)
|
|
1183
|
-
|
|
1184
|
-
return await self._client.resume_session(
|
|
1185
|
-
session_id,
|
|
1186
|
-
on_permission_request=permission_handler,
|
|
1187
|
-
streaming=streaming,
|
|
1188
|
-
model=model or None,
|
|
1189
|
-
system_message=system_message or None,
|
|
1190
|
-
tools=tools or None,
|
|
1191
|
-
mcp_servers=mcp_servers or None,
|
|
1192
|
-
provider=provider or None,
|
|
1193
|
-
instruction_directories=instruction_directories,
|
|
1194
|
-
skill_directories=skill_directories,
|
|
1195
|
-
disabled_skills=disabled_skills,
|
|
1196
|
-
hooks=hooks,
|
|
1197
|
-
)
|
|
1275
|
+
return await self._client.resume_session(session_id, **self._build_session_kwargs(streaming, runtime_options))
|
|
1198
1276
|
|
|
1199
1277
|
|
|
1200
1278
|
class GitHubCopilotAgent( # type: ignore[misc]
|
{agent_framework_github_copilot-1.0.0rc3 → agent_framework_github_copilot-1.0.1}/pyproject.toml
RENAMED
|
@@ -4,7 +4,7 @@ description = "GitHub Copilot integration for Microsoft Agent Framework."
|
|
|
4
4
|
authors = [{ name = "Microsoft", email = "af-support@microsoft.com"}]
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.1"
|
|
8
8
|
license-files = ["LICENSE"]
|
|
9
9
|
urls.homepage = "https://aka.ms/agent-framework"
|
|
10
10
|
urls.source = "https://github.com/microsoft/agent-framework/tree/main/python"
|
|
@@ -12,7 +12,7 @@ urls.release_notes = "https://github.com/microsoft/agent-framework/releases?q=ta
|
|
|
12
12
|
urls.issues = "https://github.com/microsoft/agent-framework/issues"
|
|
13
13
|
classifiers = [
|
|
14
14
|
"License :: OSI Approved :: MIT License",
|
|
15
|
-
"Development Status ::
|
|
15
|
+
"Development Status :: 5 - Production/Stable",
|
|
16
16
|
"Intended Audience :: Developers",
|
|
17
17
|
"Programming Language :: Python :: 3",
|
|
18
18
|
"Programming Language :: Python :: 3.10",
|
|
@@ -23,7 +23,7 @@ classifiers = [
|
|
|
23
23
|
"Typing :: Typed",
|
|
24
24
|
]
|
|
25
25
|
dependencies = [
|
|
26
|
-
"agent-framework-core>=1.
|
|
26
|
+
"agent-framework-core>=1.13.0,<2",
|
|
27
27
|
"github-copilot-sdk==1.0.2; python_version >= '3.11'",
|
|
28
28
|
]
|
|
29
29
|
|
|
File without changes
|