Compare commits

...

237 Commits

Author SHA1 Message Date
Greyson LaLonde
74fb23aaa4 docs: update changelog and version for v1.12.0a1 2026-03-25 20:14:39 +08:00
Greyson LaLonde
b78ed655ea feat: bump versions to 1.12.0a1 2026-03-25 20:06:13 +08:00
Greyson LaLonde
6f58b63e5d feat: add docs-check command to analyze changes and generate docs with translations 2026-03-25 19:59:14 +08:00
Greyson LaLonde
a49f9f982b refactor: deduplicate sync/async task execution and kickoff in agent 2026-03-25 19:39:42 +08:00
nicoferdi96
62bc27826d fix: agent memory saving
Fix: Add a remember_many() method to the MemoryScope class that delegates to self._memory.remember_many(...) with the scoped path, following the exact same pattern as the existing remember() method.

Problem: When you pass memory=memory.scope("/agent/...") to an Agent, CrewAI's internal code calls remember_many() after every task to persist results. But MemoryScope never implemented remember_many() — only the parent Memory class has it.

Symptom: [ERROR]: Failed to save kickoff result to memory: 'MemoryScope' object has no attribute 'remember_many' — memories are silently never saved after agent tasks.
2026-03-25 19:20:30 +08:00
Greyson LaLonde
185b69b83b docs: add CONTRIBUTING.md 2026-03-25 16:13:55 +08:00
Greyson LaLonde
eb255584b4 feat: add arabic language support to changelog and release tooling 2026-03-25 15:55:05 +08:00
Greyson LaLonde
f5b3b2a355 docs: add modern standard arabic translation of all documentation 2026-03-25 15:44:02 +08:00
alex-clawd
b890ac0dd0 fix: use __router_paths__ for listener+router methods in FlowMeta (#5064)
When a method has both @listen and @human_feedback(emit=[...]),
the FlowMeta metaclass registered it as a router but only used
get_possible_return_constants() to detect paths. This fails for
@human_feedback methods since the paths come from the decorator's
emit param, not from return statements in the source code.

Now checks __router_paths__ first (set by @human_feedback), then
falls back to source code analysis for plain @router methods.

This was causing missing edges in the flow serializer output —
e.g. the whitepaper generator's review_infographic -> handle_cancelled,
send_slack_notification, classify_feedback edges were all missing.

Adds test: @listen + @human_feedback(emit=[...]) generates correct
router edges in serialized output.

Co-authored-by: Joao Moura <joao@crewai.com>
2026-03-25 03:42:39 -03:00
Greyson LaLonde
cb7cd12d4e fix: resolve mypy errors in crewai-files and add all packages to CI type checks 2026-03-25 13:44:57 +08:00
Greyson LaLonde
d955203e55 ci: add crewai-tools to mypy strict type checks 2026-03-25 13:29:29 +08:00
Greyson LaLonde
25305e688f chore: remove outdated BUILDING_TOOLS.md 2026-03-25 13:21:16 +08:00
Greyson LaLonde
26953c88c2 fix: resolve all strict mypy errors across crewai-tools package 2026-03-25 13:11:54 +08:00
Greyson LaLonde
8a1424534e ci: run mypy on full package instead of changed files only
Some checks failed
Build uv cache / build-cache (3.10) (push) Waiting to run
Build uv cache / build-cache (3.11) (push) Waiting to run
Build uv cache / build-cache (3.12) (push) Waiting to run
Build uv cache / build-cache (3.13) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
2026-03-25 07:05:57 +08:00
Greyson LaLonde
b53c08812d fix: use None check instead of isinstance for memory in human feedback learn 2026-03-25 06:40:25 +08:00
Greyson LaLonde
ec8d444cfc fix: resolve all mypy errors across crewai package 2026-03-25 06:03:43 +08:00
iris-clawd
8d1edd5d65 fix: pin litellm upper bound to last tested version (1.82.6) (#5044)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
The litellm optional dependency had a wide upper bound (<3) that allowed
any future litellm release to be installed automatically. This means
breaking changes in new litellm versions could affect customers immediately.

Pins the upper bound to <=1.82.6 (current latest known-good version).
When newer litellm versions are tested and validated, bump this bound
explicitly.
2026-03-24 09:38:12 -07:00
alex-clawd
7f5ffce057 feat: native OpenAI-compatible providers (OpenRouter, DeepSeek, Ollama, vLLM, Cerebras, Dashscope) (#5042)
* feat: add native OpenAI-compatible providers (OpenRouter, DeepSeek, Ollama, vLLM, Cerebras, Dashscope)

Add a data-driven OpenAI-compatible provider system that enables
native support for multiple third-party APIs that implement the
OpenAI API specification.

New providers:
- OpenRouter: 500+ models via openrouter.ai
- DeepSeek: deepseek-chat, deepseek-coder, deepseek-reasoner
- Ollama: local models (llama3, mistral, codellama, etc.)
- hosted_vllm: self-hosted vLLM servers
- Cerebras: ultra-fast inference
- Dashscope: Alibaba Qwen models (qwen-turbo, qwen-max, etc.)

Architecture:
- Single OpenAICompatibleCompletion class extends OpenAICompletion
- ProviderConfig dataclass stores per-provider settings
- Registry dict makes adding new providers a single config entry
- Handles provider-specific quirks (OpenRouter headers, Ollama
  base URL normalization, optional API keys)

Usage:
  LLM(model="deepseek/deepseek-chat")
  LLM(model="ollama/llama3")
  LLM(model="openrouter/anthropic/claude-3-opus")
  LLM(model="llama3", provider="ollama")

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix: add is_litellm=True to tests that test litellm-specific methods

Tests for _get_custom_llm_provider and _validate_call_params used
openrouter/ model prefix which now routes to native provider.
Added is_litellm=True to force litellm path since these test
litellm-specific internals.

---------

Co-authored-by: Joao Moura <joao@crewai.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 12:05:43 -03:00
iris-clawd
724ab5c5e1 fix: correct litellm quarantine wording in docs (#5041)
Removed language implying the quarantine is resolved and removed
date-specific references so the docs stay evergreen.
2026-03-24 11:43:51 -03:00
alex-clawd
82a7c364c5 refactor: decouple internal plumbing from litellm (token counting, callbacks, feature detection, errors) (#5040)
- Token counting: Make TokenCalcHandler standalone class that conditionally
  inherits from litellm.CustomLogger when litellm is available, works as
  plain object when not installed

- Callbacks: Guard set_callbacks() and set_env_callbacks() behind
  LITELLM_AVAILABLE checks - these only affect the litellm fallback path,
  native providers emit events via base_llm.py

- Feature detection: Guard supports_function_calling(), supports_stop_words(),
  and _validate_call_params() behind LITELLM_AVAILABLE checks with sensible
  defaults (True for function calling/stop words since all modern models
  support them)

- Error types: Replace litellm.exceptions.ContextWindowExceededError catches
  with pattern-based detection using LLMContextLengthExceededError._is_context_limit_error()

This decouples crewAI's internal infrastructure from litellm, allowing the
native providers (OpenAI, Anthropic, Azure, Bedrock, Gemini) to work without
litellm installed. The litellm fallback for niche providers still works when
litellm IS installed.

Co-authored-by: Joao Moura <joao@crewai.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 11:35:05 -03:00
iris-clawd
36702229d7 docs: add guide for using CrewAI without LiteLLM (#5039) 2026-03-24 11:19:02 -03:00
Greyson LaLonde
b266cf7a3e ci: add PR size and title checks, configure commitizen
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
2026-03-24 19:45:07 +08:00
Greyson LaLonde
c542cc9f70 fix: raise value error on no file support 2026-03-24 19:21:19 +08:00
Greyson LaLonde
aced3e5c29 feat(cli): add logout command and fix all mypy errors in CLI
Add `crewai logout` command that clears auth tokens and user settings.
Supports `--reset` flag to also restore all CLI settings to defaults.

Add missing type annotations to all CLI command functions, DeployCommand
and TriggersCommand __init__ methods, and create_flow to resolve all
mypy errors. Remove unused assignments of void telemetry return values.
2026-03-24 19:14:24 +08:00
Greyson LaLonde
555ee462a3 feat: agent skills
introduce the agent skills standard for packaging reusable instructions that agents can discover and activate at runtime.                                                             

- skills defined via SKILL.md with yaml frontmatter and markdown body
- three-level progressive disclosure: metadata, instructions, resources
- filesystem discovery with directory name validation                                                         
- skill lifecycle events (discovery, loaded, activated, failed)
- crew-level skills resolved once and shared across agents                                                    
- skill context injected into both task execution and standalone kickoff
2026-03-24 19:03:35 +08:00
alex-clawd
dd9ae02159 feat: automatic root_scope for hierarchical memory isolation (#5035)
* feat: automatic root_scope for hierarchical memory isolation

Crews and flows now automatically scope their memories hierarchically.
The encoding flow's LLM-inferred scope becomes a sub-scope under the
structural root, preventing memory pollution across crews/agents.

Scope hierarchy:
  /crew/{crew_name}/agent/{agent_role}/{llm-inferred}
  /flow/{flow_name}/{llm-inferred}

Changes:
- Memory class: new root_scope field, passed through remember/remember_many
- EncodingFlow: prepends root_scope to resolved scope in both fast path
  (Group A) and LLM path (Group C/D)
- Crew: auto-sets root_scope=/crew/{sanitized_name} on memory creation
- Agent executor: extends crew root with /agent/{sanitized_role} per save
- Flow: auto-sets root_scope=/flow/{sanitized_name} on memory creation
- New utils: sanitize_scope_name, normalize_scope_path, join_scope_paths

Backward compatible — no root_scope means no prefix (existing behavior).
Old memories at '/' remain accessible.

51 new tests, all existing tests pass.

* ci: retrigger tests

* fix: don't auto-set root_scope on user-provided Memory instances

When users pass their own Memory instance to a Crew (memory=mem),
respect their configuration — don't auto-set root_scope.
Auto-scoping only applies when memory=True (Crew creates Memory).

Fixes: test_crew_memory_with_google_vertex_embedder which passes
Memory(embedder=...) to Crew and expects remember(scope='/test')
to produce scope '/test', not '/crew/crew/test'.

* fix: address 6 review comments — true scope isolation for reads, writes, and consolidation

1. Constrain similarity search to root_scope boundary (no cross-crew consolidation)
2. Remove unused self._root_scope from EncodingFlow
3. Apply root_scope to recall/list/info/reset (true read isolation)
4. Only extend agent root_scope when crew has one (backward compat)
5. Fix docstring example for sanitize_scope_name
6. Verify code comments match behavior

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Joao Moura <joao@crewai.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-24 02:56:10 -03:00
Lorenze Jay
949d7f1091 docs: update changelog and version for v1.11.1 (#5031)
Some checks failed
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-03-23 16:33:43 -07:00
Lorenze Jay
3b569b8da9 feat: bump versions to 1.11.1 (#5030) 2026-03-23 16:22:19 -07:00
Matt Aitchison
e88a8f2785 fix: bump pypdf, tinytag, and langchain-core for security fixes (#4989)
- pypdf ~=6.7.5 → ~=6.9.1 (CVE-2026-33123, CVE-2026-31826)
- tinytag ~=1.10.0 → ~=2.2.1 (CVE-2026-32889)
- langchain-core >=0.3.80,<1 → >=1.2.11,<2 (CVE-2026-26013)

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
2026-03-23 15:24:26 -07:00
Lorenze Jay
85199e9ffc better serialization for human feedback in flow with models defined a… (#5029)
* better serialization for human feedback in flow with models defined as dicts

* linted

* linted

* fix and adjust tests
2026-03-23 14:43:43 -07:00
Daniel Barreto
c92de53da7 refactor(rag): replace urllib with requests in pdf loader (#5026)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
2026-03-23 12:47:39 -03:00
alex-clawd
1704ccdfa8 feat: add flow_structure() serializer for Flow class introspection (#5021)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
* feat: add flow_structure() serializer for Flow class introspection

Adds a new flow_serializer module that introspects a Flow class and returns
a JSON-serializable dictionary describing its complete graph structure.

This enables Studio UI to render visual flow graphs (analogous to how
crew_structure() works for Crews).

The serializer extracts:
- Method metadata (type, triggers, conditions, router paths)
- Edge graph (listen and route edges between methods)
- State schema (from Pydantic model if typed)
- Human feedback and Crew reference detection
- Flow input detection

Includes 23 comprehensive tests covering linear flows, routers,
AND/OR conditions, human feedback, crew detection, state schemas,
edge cases, and JSON serialization.

* fix: lint — ruff check + format compliance for flow_serializer

* fix: address review — PydanticUndefined bug, FlowCondition tuple handling, dead code cleanup, inheritance tests

1. Fix PydanticUndefined default handling (real bug) — required fields
   were serialized with sentinel value instead of null
2. Fix FlowCondition tuple type in _extract_all_methods_from_condition —
   tuple conditions now properly extracted
3. Remove dead get_flow_inputs branch that did nothing
4. Document _detect_crew_reference as best-effort heuristic
5. Add 2 inheritance tests (parent→child method propagation)

---------

Co-authored-by: Joao Moura <joao@crewai.com>
2026-03-23 02:31:00 -03:00
alex-clawd
09b84dd2b0 fix: preserve full LLM config across HITL resume for non-OpenAI providers (#4970)
Some checks failed
Check Documentation Broken Links / Check broken links (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
When a flow with @human_feedback(llm=create_llm()) pauses for HITL and
later resumes:

1. The LLM object was being serialized to just a model string via
   _serialize_llm_for_context() (e.g. 'gemini/gemini-3.1-flash-lite-preview')
2. On resume, resume_async() was creating LLM(model=string) with NO
   credentials, project, location, safety_settings, or client_params
3. OpenAI worked by accident (OPENAI_API_KEY from env), but Gemini with
   service accounts broke

This fix:
- Stashes the live LLM object on the wrapper as _hf_llm attribute
- On resume, looks up the method and retrieves the live LLM if available
- Falls back to the serialized string for backward compatibility
- Preserves _hf_llm through FlowMethod wrapper decorators

Co-authored-by: Joao Moura <joao@crewai.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-20 18:42:28 -03:00
Greyson LaLonde
f13d307534 fix: pass cache_function from BaseTool to CrewStructuredTool 2026-03-20 16:04:52 -04:00
Lucas Gomide
8e427164ca docs: adding a lot of missinge vent listeners (#4990)
Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-03-20 15:30:11 -04:00
Greyson LaLonde
6495aff528 refactor: replace Any-typed callback and model fields with serializable types 2026-03-20 15:18:50 -04:00
Greyson LaLonde
f7de8b2d28 fix(devtools): consolidate prerelease changelogs into stable releases
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
2026-03-19 17:16:18 -04:00
Greyson LaLonde
8886f11672 docs: add publish custom tools guide with translations
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
2026-03-19 11:15:56 -04:00
Rip&Tear
713fa7d01b fix: prevent path traversal in FileWriterTool (#4895)
* fix: add base_dir path containment to FileWriterTool

os.path.join does not prevent traversal — joining "./" with "../../../etc/cron.d/pwned"
resolves cleanly outside any intended scope. The tool also called os.makedirs on
the unvalidated path, meaning it would create arbitrary directory structures.

Adds a base_dir parameter that uses os.path.realpath() to resolve the final path
(including symlinks) before checking containment. Any filename or directory argument
that resolves outside base_dir is rejected before any filesystem operation occurs.

When base_dir is not set the tool behaves as before — only use that in fully
sandboxed environments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: make directory relative to base_dir for better UX

When base_dir is set, the directory arg is now treated as a subdirectory
of base_dir rather than an absolute path. This means the LLM only needs
to specify a filename (and optionally a relative subdirectory) — it does
not need to repeat the base_dir path.

  FileWriterTool(base_dir="./output")
  → filename="report.txt"            writes to ./output/report.txt
  → filename="f.txt", directory="sub" writes to ./output/sub/f.txt

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: remove directory field from LLM schema when base_dir is set

When a developer sets base_dir, they control where files are written.
The LLM should only supply filename and content — not a directory path.

Adds ScopedFileWriterToolInput (no directory field) which is used when
base_dir is provided at construction, following the same pattern as
FileReadTool/ScrapeWebsiteTool.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: prevent path traversal in FileWriterTool without interface changes

Adds containment check inside _run() using os.path.realpath() to ensure
the resolved file path stays within the resolved directory. Blocks ../
sequences, absolute filenames, and symlink escapes transparently —
no schema or interface changes required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: use Path.is_relative_to() for path containment check

Replaces startswith(real_directory + os.sep) with Path.is_relative_to(),
which does a proper path-component comparison. This avoids the edge case
where real_directory == "/" produces a "//" prefix, and is safe on
case-insensitive filesystems. Also explicitly rejects the case where
the filepath resolves to the directory itself (not a valid file target).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* test: fix portability issues in path traversal tests

- test_blocks_traversal_in_filename: use a sibling temp dir instead of
  asserting against a potentially pre-existing ../outside.txt
- test_blocks_absolute_path_in_filename: use a temp-dir-derived absolute
  path instead of hardcoding /etc/passwd
- test_blocks_symlink_escape: symlink to a temp "outside" dir instead of
  /etc, assert target file was not created

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-03-19 20:11:45 +08:00
Greyson LaLonde
929d756ae2 chore: add coding tool environment detection via telemetry events 2026-03-19 07:34:11 -04:00
Vini Brasil
6b262f5a6d Fix lock_store crash when redis package is not installed (#4943)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* Fix lock_store crash when redis package is not installed

`REDIS_URL` being set was enough to trigger a Redis lock, which would
raise `ImportError` if the `redis` package wasn't available. Added
`_redis_available()` to guard on both the env var and the import.

* Simplify tests

* Simplify tests #2
2026-03-18 15:05:41 -03:00
dependabot[bot]
6a6adaf2da chore(deps): bump pyasn1 (#4925)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Bumps the security-updates group with 1 update in the / directory: [pyasn1](https://github.com/pyasn1/pyasn1).


Updates `pyasn1` from 0.6.2 to 0.6.3
- [Release notes](https://github.com/pyasn1/pyasn1/releases)
- [Changelog](https://github.com/pyasn1/pyasn1/blob/main/CHANGES.rst)
- [Commits](https://github.com/pyasn1/pyasn1/compare/v0.6.2...v0.6.3)

---
updated-dependencies:
- dependency-name: pyasn1
  dependency-version: 0.6.3
  dependency-type: indirect
  dependency-group: security-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-18 12:16:59 -05:00
Greyson LaLonde
116182f708 docs: update changelog and version for v1.11.0 2026-03-18 09:38:38 -04:00
Greyson LaLonde
9eed13b8a2 feat: bump versions to 1.11.0 2026-03-18 09:30:05 -04:00
Greyson LaLonde
50b2c7d072 docs: update changelog and version for v1.11.0rc2
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-03-17 17:07:26 -04:00
Greyson LaLonde
e9ba4932a0 feat: bump versions to 1.11.0rc2 2026-03-17 16:58:59 -04:00
Tanishq
0b07b4c45f docs: update Exa Search Tool page with improved naming, description, and configuration options (#4800)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
* docs: update Exa Search Tool page with improved naming, description, and configuration options

Co-Authored-By: Tanishq Jaiswal <tanishq.jaiswal97@gmail.com>

* docs: fix API key link and remove neural/keyword search type references

Co-Authored-By: Tanishq Jaiswal <tanishq.jaiswal97@gmail.com>

* docs: add instant, fast, auto, deep search types

Co-Authored-By: Tanishq Jaiswal <tanishq.jaiswal97@gmail.com>

---------

Co-authored-by: João Moura <joaomdmoura@gmail.com>
2026-03-17 12:27:41 -03:00
João Moura
6235810844 fix: enhance LLM response handling and serialization (#4909)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* fix: enhance LLM response handling and serialization

* Updated the Flow class to improve error handling when both structured and simple prompting fail, ensuring the first outcome is returned as a fallback.
* Introduced a new function, _serialize_llm_for_context, to properly serialize LLM objects with provider prefixes for better context management.
* Added tests to validate the new serialization logic and ensure correct behavior when LLM calls fail.

This update enhances the robustness of LLM interactions and improves the overall flow of handling outcomes.

* fix: patch VCR response handling to prevent httpx.ResponseNotRead errors (#4917)

* fix: enhance LLM response handling and serialization

* Updated the Flow class to improve error handling when both structured and simple prompting fail, ensuring the first outcome is returned as a fallback.
* Introduced a new function, _serialize_llm_for_context, to properly serialize LLM objects with provider prefixes for better context management.
* Added tests to validate the new serialization logic and ensure correct behavior when LLM calls fail.

This update enhances the robustness of LLM interactions and improves the overall flow of handling outcomes.

* fix: patch VCR response handling to prevent httpx.ResponseNotRead errors

VCR's _from_serialized_response mocks httpx.Response.read(), which
prevents the response's internal _content attribute from being properly
initialized. When OpenAI's client (using with_raw_response) accesses
response.content, httpx raises ResponseNotRead.

This patch explicitly sets response._content after the response is
created, ensuring that tests using VCR cassettes work correctly with
the OpenAI client's raw response handling.

Fixes tests:
- test_hierarchical_crew_creation_tasks_with_sync_last
- test_conditional_task_last_task_when_conditional_is_false
- test_crew_log_file_output

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Joao Moura <joaomdmoura@gmail.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: alex-clawd <alex@crewai.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-03-17 05:19:31 -03:00
Matt Aitchison
b95486c187 fix: upgrade vulnerable transitive dependencies (authlib, PyJWT, snowflake-connector-python) (#4913)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
- authlib 1.6.7 → 1.6.9 (CVE-2026-27962 critical, CVE-2026-28498, CVE-2026-28490)
- PyJWT 2.11.0 → 2.12.1 (CVE-2026-32597)
- snowflake-connector-python 4.2.0 → 4.3.0
2026-03-16 19:02:39 -05:00
Lucas Gomide
ead8e8d6e6 docs: add Custom MCP Servers in How-To Guide (#4911) 2026-03-16 17:01:41 -04:00
Vini Brasil
5bbf9c8e03 Update OTEL collectors documentation (#4908)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
* Update OTEL collectors documentation

* Add translations
2026-03-16 13:27:57 -03:00
Greyson LaLonde
5053fae8a1 docs: update changelog and version for v1.11.0rc1 2026-03-16 09:55:45 -04:00
Lucas Gomide
9facd96aad docs: update MCP documentation (#4904) 2026-03-16 09:13:10 -04:00
Rip&Tear
9acb327d9f fix: replace os.system with subprocess.run in unsafe mode pip install
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* fix: replace os.system with subprocess.run in unsafe mode pip install

Eliminates shell injection risk (A05) where a malicious library name like
"pkg; rm -rf /" could execute arbitrary host commands. Using list-form
subprocess.run with shell=False ensures the library name is always treated
as a single argument with no shell metacharacter expansion.

Adds two tests: one verifying list-form invocation, one verifying that
shell metacharacters in a library name cannot trigger shell execution.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix: use sys.executable -m pip to satisfy S607 linting rule

S607 flags partial executable paths like ["pip", ...]. Using
[sys.executable, "-m", "pip", ...] provides an absolute path and also
ensures installation targets the correct Python environment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-03-16 02:04:24 -04:00
Greyson LaLonde
aca0817421 feat: bump versions to 1.11.0rc1 2026-03-15 23:37:20 -04:00
Greyson LaLonde
4d21c6e4ad feat(a2a): add plus api token auth
* feat(a2a): add plus api token auth

* feat(a2a): use stub for plus api

* fix: use dynamic separator in slugify for dedup and strip

* fix: remove unused _DUPLICATE_SEPARATOR_PATTERN, cache compiled regex in slugify
2026-03-15 23:30:29 -04:00
Lorenze Jay
32d7b4a8d4 Lorenze/feat/plan execute pattern (#4817)
* feat: introduce PlanningConfig for enhanced agent planning capabilities (#4344)

* feat: introduce PlanningConfig for enhanced agent planning capabilities

This update adds a new PlanningConfig class to manage agent planning configurations, allowing for customizable planning behavior before task execution. The existing reasoning parameter is deprecated in favor of this new configuration, ensuring backward compatibility while enhancing the planning process. Additionally, the Agent class has been updated to utilize this new configuration, and relevant utility functions have been adjusted accordingly. Tests have been added to validate the new planning functionality and ensure proper integration with existing agent workflows.

* dropping redundancy

* fix test

* revert handle_reasoning here

* refactor: update reasoning handling in Agent class

This commit modifies the Agent class to conditionally call the handle_reasoning function based on the executor class being used. The legacy CrewAgentExecutor will continue to utilize handle_reasoning, while the new AgentExecutor will manage planning internally. Additionally, the PlanningConfig class has been referenced in the documentation to clarify its role in enabling or disabling planning. Tests have been updated to reflect these changes and ensure proper functionality.

* improve planning prompts

* matching

* refactor: remove default enabled flag from PlanningConfig in Agent class

* more cassettes

* fix test

* refactor: update planning prompt and remove deprecated methods in reasoning handler

* improve planning prompt

* Lorenze/feat planning pt 2 todo list gen (#4449)

* feat: introduce PlanningConfig for enhanced agent planning capabilities

This update adds a new PlanningConfig class to manage agent planning configurations, allowing for customizable planning behavior before task execution. The existing reasoning parameter is deprecated in favor of this new configuration, ensuring backward compatibility while enhancing the planning process. Additionally, the Agent class has been updated to utilize this new configuration, and relevant utility functions have been adjusted accordingly. Tests have been added to validate the new planning functionality and ensure proper integration with existing agent workflows.

* dropping redundancy

* fix test

* revert handle_reasoning here

* refactor: update reasoning handling in Agent class

This commit modifies the Agent class to conditionally call the handle_reasoning function based on the executor class being used. The legacy CrewAgentExecutor will continue to utilize handle_reasoning, while the new AgentExecutor will manage planning internally. Additionally, the PlanningConfig class has been referenced in the documentation to clarify its role in enabling or disabling planning. Tests have been updated to reflect these changes and ensure proper functionality.

* improve planning prompts

* matching

* refactor: remove default enabled flag from PlanningConfig in Agent class

* more cassettes

* fix test

* feat: enhance agent planning with structured todo management

This commit introduces a new planning system within the AgentExecutor class, allowing for the creation of structured todo items from planning steps. The TodoList and TodoItem models have been added to facilitate tracking of plan execution. The reasoning plan now includes a list of steps, improving the clarity and organization of agent tasks. Additionally, tests have been added to validate the new planning functionality and ensure proper integration with existing workflows.

* refactor: update planning prompt and remove deprecated methods in reasoning handler

* improve planning prompt

* improve handler

* linted

* linted

* Lorenze/feat/planning pt 3 todo list execution (#4450)

* feat: introduce PlanningConfig for enhanced agent planning capabilities

This update adds a new PlanningConfig class to manage agent planning configurations, allowing for customizable planning behavior before task execution. The existing reasoning parameter is deprecated in favor of this new configuration, ensuring backward compatibility while enhancing the planning process. Additionally, the Agent class has been updated to utilize this new configuration, and relevant utility functions have been adjusted accordingly. Tests have been added to validate the new planning functionality and ensure proper integration with existing agent workflows.

* dropping redundancy

* fix test

* revert handle_reasoning here

* refactor: update reasoning handling in Agent class

This commit modifies the Agent class to conditionally call the handle_reasoning function based on the executor class being used. The legacy CrewAgentExecutor will continue to utilize handle_reasoning, while the new AgentExecutor will manage planning internally. Additionally, the PlanningConfig class has been referenced in the documentation to clarify its role in enabling or disabling planning. Tests have been updated to reflect these changes and ensure proper functionality.

* improve planning prompts

* matching

* refactor: remove default enabled flag from PlanningConfig in Agent class

* more cassettes

* fix test

* feat: enhance agent planning with structured todo management

This commit introduces a new planning system within the AgentExecutor class, allowing for the creation of structured todo items from planning steps. The TodoList and TodoItem models have been added to facilitate tracking of plan execution. The reasoning plan now includes a list of steps, improving the clarity and organization of agent tasks. Additionally, tests have been added to validate the new planning functionality and ensure proper integration with existing workflows.

* refactor: update planning prompt and remove deprecated methods in reasoning handler

* improve planning prompt

* improve handler

* execute todos and be able to track them

* feat: introduce PlannerObserver and StepExecutor for enhanced plan execution

This commit adds the PlannerObserver and StepExecutor classes to the CrewAI framework, implementing the observation phase of the Plan-and-Execute architecture. The PlannerObserver analyzes step execution results, determines plan validity, and suggests refinements, while the StepExecutor executes individual todo items in isolation. These additions improve the overall planning and execution process, allowing for more dynamic and responsive agent behavior. Additionally, new observation events have been defined to facilitate monitoring and logging of the planning process.

* refactor: enhance final answer synthesis in AgentExecutor

This commit improves the synthesis of final answers in the AgentExecutor class by implementing a more coherent approach to combining results from multiple todo items. The method now utilizes a single LLM call to generate a polished response, falling back to concatenation if the synthesis fails. Additionally, the test cases have been updated to reflect the changes in planning and execution, ensuring that the results are properly validated and that the plan-and-execute architecture is functioning as intended.

* refactor: enhance final answer synthesis in AgentExecutor

This commit improves the synthesis of final answers in the AgentExecutor class by implementing a more coherent approach to combining results from multiple todo items. The method now utilizes a single LLM call to generate a polished response, falling back to concatenation if the synthesis fails. Additionally, the test cases have been updated to reflect the changes in planning and execution, ensuring that the results are properly validated and that the plan-and-execute architecture is functioning as intended.

* refactor: implement structured output handling in final answer synthesis

This commit enhances the final answer synthesis process in the AgentExecutor class by introducing support for structured outputs when a response model is specified. The synthesis method now utilizes the response model to produce outputs that conform to the expected schema, while still falling back to concatenation in case of synthesis failures. This change ensures that intermediate steps yield free-text results, but the final output can be structured, improving the overall coherence and usability of the synthesized answers.

* regen tests

* linted

* fix

* Enhance PlanningConfig and AgentExecutor with Reasoning Effort Levels

This update introduces a new  attribute in the  class, allowing users to customize the observation and replanning behavior during task execution. The  class has been modified to utilize this new attribute, routing step observations based on the specified reasoning effort level: low, medium, or high.

Additionally, tests have been added to validate the functionality of the reasoning effort levels, ensuring that the agent behaves as expected under different configurations. This enhancement improves the adaptability and efficiency of the planning process in agent execution.

* regen cassettes for test and fix test

* cassette regen

* fixing tests

* dry

* Refactor PlannerObserver and StepExecutor to Utilize I18N for Prompts

This update enhances the PlannerObserver and StepExecutor classes by integrating the I18N utility for managing prompts and messages. The system and user prompts are now retrieved from the I18N module, allowing for better localization and maintainability. Additionally, the code has been cleaned up to remove hardcoded strings, improving readability and consistency across the planning and execution processes.

* Refactor PlannerObserver and StepExecutor to Utilize I18N for Prompts

This update enhances the PlannerObserver and StepExecutor classes by integrating the I18N utility for managing prompts and messages. The system and user prompts are now retrieved from the I18N module, allowing for better localization and maintainability. Additionally, the code has been cleaned up to remove hardcoded strings, improving readability and consistency across the planning and execution processes.

* consolidate agent logic

* fix datetime

* improving step executor

* refactor: streamline observation and refinement process in PlannerObserver

- Updated the PlannerObserver to apply structured refinements directly from observations without requiring a second LLM call.
- Renamed  method to  for clarity.
- Enhanced documentation to reflect changes in how refinements are handled.
- Removed unnecessary LLM message building and parsing logic, simplifying the refinement process.
- Updated event emissions to include summaries of refinements instead of raw data.

* enhance step executor with tool usage events and validation

- Added event emissions for tool usage, including started and finished events, to track tool execution.
- Implemented validation to ensure expected tools are called during step execution, raising errors when not.
- Refactored the  method to handle tool execution with event logging.
- Introduced a new method  for parsing tool input into a structured format.
- Updated tests to cover new functionality and ensure correct behavior of tool usage events.

* refactor: enhance final answer synthesis logic in AgentExecutor

- Updated the finalization process to conditionally skip synthesis when the last todo result is sufficient as a complete answer.
- Introduced a new method to determine if the last todo result can be used directly, improving efficiency.
- Added tests to verify the new behavior, ensuring synthesis is skipped when appropriate and maintained when a response model is set.

* fix: update observation handling in PlannerObserver for LLM errors

- Modified the error handling in the PlannerObserver to default to a conservative replan when an LLM call fails.
- Updated the return values to indicate that the step was not completed successfully and that a full replan is needed.
- Added a new test to verify the behavior of the observer when an LLM error occurs, ensuring the correct replan logic is triggered.

* refactor: enhance planning and execution flow in agents

- Updated the PlannerObserver to accept a kickoff input for standalone task execution, improving flexibility in task handling.
- Refined the step execution process in StepExecutor to support multi-turn action loops, allowing for iterative tool execution and observation.
- Introduced a method to extract relevant task sections from descriptions, ensuring clarity in task requirements.
- Enhanced the AgentExecutor to manage step failures more effectively, triggering replans only when necessary and preserving completed task history.
- Updated translations to reflect changes in planning principles and execution prompts, emphasizing concrete and executable steps.

* refactor: update setup_native_tools to include tool_name_mapping

- Modified the setup_native_tools function to return an additional mapping of tool names.
- Updated StepExecutor and AgentExecutor classes to accommodate the new return value from setup_native_tools.

* fix tests

* linted

* linted

* feat: enhance image block handling in Anthropic provider and update AgentExecutor logic

- Added a method to convert OpenAI-style image_url blocks to Anthropic's required format.
- Updated AgentExecutor to handle cases where no todos are ready, introducing a needs_replan return state.
- Improved fallback answer generation in AgentExecutor to prevent RuntimeErrors when no final output is produced.

* lint

* lint

* 1. Added failed to TodoStatus (planning_types.py)

  - TodoStatus now includes failed as a valid state: Literal[pending, running, completed, failed]
  - Added mark_failed(step_number, result) method to TodoList
  - Added get_failed_todos() method to TodoList
  - Updated is_complete to treat both completed and failed as terminal states
  - Updated replace_pending_todos docstring to mention failed items are preserved

  2. Mark running todos as failed before replan (agent_executor.py)

  All three effort-level handlers now call mark_failed() on the current todo before routing to replan_now:

  - Low effort (handle_step_observed_low): hard-failure branch
  - Medium effort (handle_step_observed_medium): needs_full_replan branch
  - High effort (decide_next_action): both needs_full_replan and step_completed_successfully=False branches

  3. Updated _should_replan to use get_failed_todos()

  Previously filtered on todo.status == failed which was dead code. Now uses the proper accessor method that will actually find failed items.

  What this fixes: Before these changes, a step that triggered a replan would stay in running status permanently, causing is_complete to never
  return True and next_pending to skip it — leading to stuck execution states. Now failed steps are properly tracked, replanning context correctly
  reports them, and LiteAgentOutput.failed_todos will actually return results.

* fix test

* imp on failed states

* adjusted the var name from AgentReActState to AgentExecutorState

* addressed p0 bugs

* more improvements

* linted

* regen cassette

* addressing crictical comments

* ensure configurable timeouts, max_replans and max step iterations

* adjusted tools

* dropping debug statements

* addressed comment

* fix  linter

* lints and test fixes

* fix: default observation parse fallback to failure and clean up plan-execute types

When _parse_observation_response fails all parse attempts, default to
step_completed_successfully=False instead of True to avoid silently
masking failures. Extract duplicate _extract_task_section into a shared
utility in agent_utils. Type PlanningConfig.llm as str | BaseLLM | None
instead of str | Any | None. Make StepResult a frozen dataclass for
immutability consistency with StepExecutionContext.

* fix: remove Any from function_calling_llm union type in step_executor

* fix: make BaseTool usage count thread-safe for parallel step execution

Add _usage_lock and _claim_usage() to BaseTool for atomic
check-and-increment of current_usage_count. This prevents race
conditions when parallel plan steps invoke the same tool concurrently
via execute_todos_parallel. Remove the racy pre-check from
execute_single_native_tool_call since the limit is now enforced
atomically inside tool.run().

---------

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
Co-authored-by: Greyson LaLonde <greyson@crewai.com>
2026-03-15 18:33:17 -07:00
Rip&Tear
fb2323b3de Code interpreter sandbox escape (#4791)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
* [SECURITY] Fix sandbox escape vulnerability in CodeInterpreterTool (F-001)

This commit addresses a critical security vulnerability where the CodeInterpreterTool
could be exploited via sandbox escape attacks when Docker was unavailable.

Changes:
- Remove insecure fallback to restricted sandbox in run_code_safety()
- Now fails closed with RuntimeError when Docker is unavailable
- Mark run_code_in_restricted_sandbox() as deprecated and insecure
- Add clear security warnings to SandboxPython class documentation
- Update tests to reflect secure-by-default behavior
- Add test demonstrating the sandbox escape vulnerability
- Update README with security requirements and best practices

The previous implementation would fall back to a Python-based 'restricted sandbox'
when Docker was unavailable. However, this sandbox could be easily bypassed using
Python object introspection to recover the original __import__ function, allowing
arbitrary module access and command execution on the host.

The fix enforces Docker as a requirement for safe code execution. Users who cannot
use Docker must explicitly enable unsafe_mode=True, acknowledging the security risks.

Security Impact:
- Prevents RCE via sandbox escape when Docker is unavailable
- Enforces fail-closed security model
- Maintains backward compatibility via unsafe_mode flag

References:
- https://docs.crewai.com/tools/ai-ml/codeinterpretertool

Co-authored-by: Rip&Tear <theCyberTech@users.noreply.github.com>

* Add security fix documentation for F-001

Co-authored-by: Rip&Tear <theCyberTech@users.noreply.github.com>

* Add Slack summary for security fix

Co-authored-by: Rip&Tear <theCyberTech@users.noreply.github.com>

* Delete SECURITY_FIX_F001.md

* Delete SLACK_SUMMARY.md

* chore: regen cassettes

* chore: regen more cassettes

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Rip&Tear <theCyberTech@users.noreply.github.com>
Co-authored-by: Greyson LaLonde <greyson@crewai.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-15 13:18:02 +08:00
Greyson LaLonde
e1d7de0dba docs: update changelog and version for v1.10.2rc2
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
2026-03-14 00:49:48 -04:00
Greyson LaLonde
96b07bfc84 feat: bump versions to 1.10.2rc2 2026-03-14 00:34:12 -04:00
Greyson LaLonde
b8d7942675 fix: remove exclusive locks from read-only storage operations
* fix: remove exclusive locks from read-only storage operations to eliminate lock contention

read operations like search, list_scopes, get_scope_info, count across
LanceDB, ChromaDB, and RAG adapters were holding exclusive locks unnecessarily.
under multi-process prefork workers this caused RedisLock contention triggering
a portalocker bug where AlreadyLocked is raised with the exceptions module as its arg.

- remove store_lock from 7 LanceDB read methods since MVCC handles concurrent reads
- remove store_lock from ChromaDB search/asearch which are thread-safe since v0.4
- remove store_lock from RAG core query and LanceDB adapter query
- wrap lock_store BaseLockException with actionable error message
- add exception handling in encoding_flow/recall_flow ThreadPoolExecutor calls
- fix flow.py double-logging of ancestor listener errors

* fix: remove dead conditional in filter_and_chunk fallback

both branches of the if/else and the except all produced the same
candidates = [scope_prefix] result, making the get_scope_info call
and conditional pointless

* fix: separate lock acquisition from caller body in lock_store

the try/except wrapped the yield inside the contextmanager, which meant
any BaseLockException raised by the caller's code inside the with block
would be caught and re-raised with a misleading "Failed to acquire lock"
message. split into acquire-then-yield so only actual acquisition
failures get the actionable error message.
2026-03-14 00:21:14 -04:00
Greyson LaLonde
88fd859c26 docs: update changelog and version for v1.10.2rc1
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
2026-03-13 17:07:31 -04:00
Greyson LaLonde
3413f2e671 feat: bump versions to 1.10.2rc1 2026-03-13 16:53:48 -04:00
Greyson LaLonde
326ec15d54 feat(devtools): add release command and trigger PyPI publish
* feat(devtools): add release command and fix automerge on protected branches

Replace gh pr merge --auto with polling-based merge wait that prints the
PR URL for manual review. Add unified release command that chains bump
and tag into a single end-to-end workflow.

* feat(devtools): trigger PyPI publish workflow after GitHub release

* refactor(devtools): extract shared helpers to eliminate duplication

Extract _poll_pr_until_merged, _update_all_versions,
_generate_release_notes, _update_docs_and_create_pr,
_create_tag_and_release, and _trigger_pypi_publish into reusable
helpers. All three commands (bump, tag, release) now compose from
these shared functions.
2026-03-13 16:41:27 -04:00
Greyson LaLonde
c5a8fef118 fix: add cross-process and thread-safe locking to unprotected I/O (#4827)
* fix: add cross-process and thread-safe locking to unprotected I/O

* style: apply ruff formatting and import sorting

* fix: avoid event loop deadlock in snowflake pool lock

* perf: move embedding calls outside cross-process lock in RAG adapter

* fix: close TOCTOU race in browser session manager

* fix: add error handling to update_user_data

* fix: use async lock acquisition in chromadb async methods

* fix: avoid blocking event loop in async browser session wait

* fix: replace dual-lock with single cross-process lock in LanceDB storage

* fix: remove dead _save_user_data function and stale mock

* fix: re-addd file descriptor limit to prevent crashes
2026-03-13 12:28:11 -07:00
Greyson LaLonde
b7af26ff60 ci: add slack notification on successful pypi publish 2026-03-13 12:05:52 -04:00
Greyson LaLonde
48eb7c6937 fix: propagate contextvars across all thread and executor boundaries
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-03-13 00:32:22 -04:00
danglies007
d8e38f2f0b fix: propagate ContextVars into async task threads
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
threading.Thread() does not inherit the parent's contextvars.Context,
causing ContextVar-based state (OpenTelemetry spans, Langfuse trace IDs,
and any other request-scoped vars) to be silently dropped in async tasks.

Fix by calling contextvars.copy_context() before spawning each thread and
using ctx.run() as the thread target, which runs the function inside the
captured context.

Affected locations:
- task.py: execute_async() — the primary async task execution path
- utilities/streaming.py: create_chunk_generator() — streaming execution path

Fixes: #4822
Related: #4168, #4286

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-12 15:33:58 -04:00
Greyson LaLonde
542afe61a8 docs: update changelog and version for v1.10.2a1
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-03-11 11:44:00 -04:00
Greyson LaLonde
8a5b3bc237 feat: bump versions to 1.10.2a1
* feat: bump versions to 1.10.2a1

* chore: update tool specifications

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-11 11:30:11 -04:00
Greyson LaLonde
534f0707ca fix: resolve LockException under concurrent multi-process execution 2026-03-11 11:15:24 -04:00
Giulio Leone
0046f9a96f fix(bedrock): group parallel tool results in single user message (#4775)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* fix(bedrock): group parallel tool results in single user message

When an AWS Bedrock model makes multiple tool calls in a single
response, the Converse API requires all corresponding tool results
to be sent back in a single user message. Previously, each tool
result was emitted as a separate user message, causing:

  ValidationException: Expected toolResult blocks at messages.2.content

Fix: When processing consecutive tool messages, append the toolResult
block to the preceding user message (if it already contains
toolResult blocks) instead of creating a new message. This groups
all parallel tool results together while keeping tool results from
different assistant turns separate.

Fixes #4749

Signed-off-by: Giulio Leone <6887247+giulio-leone@users.noreply.github.com>

* Update lib/crewai/tests/llms/bedrock/test_bedrock.py

* fix: group bedrock tool results

Co-authored-by: João Moura <joaomdmoura@gmail.com>

---------

Signed-off-by: Giulio Leone <6887247+giulio-leone@users.noreply.github.com>
Co-authored-by: Giulio Leone <6887247+giulio-leone@users.noreply.github.com>
Co-authored-by: João Moura <joaomdmoura@gmail.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-03-10 17:28:40 -03:00
Lucas Gomide
e72a80be6e Addressing MCP tools resolutions & eliminates all shared mutable connection (#4792)
* fix: allow hyphenated tool names in MCP references like notion#get-page

The _SLUG_RE regex on BaseAgent rejected MCP tool references containing
hyphens (e.g. "notion#get-page") because the fragment pattern only
matched \w (word chars)

* fix: create fresh MCP client per tool invocation to prevent parallel call races

When the LLM dispatches parallel calls to MCP tools on the same server, the executor runs them concurrently via ThreadPoolExecutor. Previously, all tools from a server shared a single MCPClient instance, and even the same tool called twice would reuse one client. Since each thread creates its own asyncio event loop via asyncio.run(), concurrent connect/disconnect calls on the shared client caused anyio cancel-scope errors ("Attempted to exit cancel scope in a different task than it was entered in").

The fix introduces a client_factory pattern: MCPNativeTool now receives a zero-arg callable that produces a fresh MCPClient + transport on every
_run_async() invocation. This eliminates all shared mutable connection state between concurrent calls, whether to the same tool or different tools from the same server.

* test: ensure we can filter hyphenated MCP tool
2026-03-10 14:00:40 -04:00
Lorenze Jay
7cffcab84a ensure we support tool search - saving tokens and dynamically inject appropriate tools during execution - anthropic (#4779)
* ensure we support tool search

* linted

* dont tool search if there is only one tool
2026-03-10 10:48:13 -07:00
João Moura
f070ce8abd fix: update llm parameter handling in human_feedback function (#4801)
Modified the llm parameter assignment to retrieve the model attribute from llm if it is not a string, ensuring compatibility with different llm types.
2026-03-10 14:27:09 -03:00
Sampson
d9f6e2222f Introduce more Brave Search tools (#4446)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* feat: add dedicated Brave Search tools for web, news, image, video, local POIs, and Brave's newest LLM Context endpoint

* fix: normalize transformed response shape

* revert legacy tool name

* fix: schema change prevented property resolution

* Update tool.specs.json

* fix: add fallback for search_langugage

* simplify exports

* makes rate-limiting logic per-instance

* fix(brave-tools): correct _refine_response return type annotations

The abstract method and subclasses annotated _refine_response as returning
dict[str, Any] but most implementations actually return list[dict[str, Any]].
Updated base to return Any, and each subclass to match its actual return type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Joao Moura <joaomdmoura@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 01:38:54 -03:00
Lucas Gomide
adef605410 fix: add missing list/dict methods to LockedListProxy and LockedDictProxy
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
2026-03-09 09:38:35 -04:00
Greyson LaLonde
cd42bcf035 refactor(memory): convert memory classes to serializable
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* refactor(memory): convert Memory, MemoryScope, and MemorySlice to BaseModel

* fix(test): update mock memory attribute from _read_only to read_only

* fix: handle re-validation in wrap validators and patch BaseModel class in tests
2026-03-08 23:08:10 -04:00
Greyson LaLonde
bc45a7fbe3 feat: create action for nightly releases
Some checks failed
Nightly Canary Release / Check for new commits (push) Has been cancelled
Nightly Canary Release / Build nightly packages (push) Has been cancelled
Nightly Canary Release / Publish nightly to PyPI (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-03-06 18:32:52 -05:00
Matt Aitchison
87759cdb14 fix(deps): bump gitpython to >=3.1.41 to resolve CVE path traversal vulnerability (#4740)
Some checks failed
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
GitPython ==3.1.38 is affected by a high-severity path traversal
vulnerability (dependabot alert #1). Bump to >=3.1.41,<4 which
includes the fix.
2026-03-05 12:41:24 -06:00
Tiago Freire
059cb93aeb fix(executor): propagate contextvars context to parallel tool call threads
ThreadPoolExecutor threads do not inherit the calling thread's contextvars
context, causing _event_id_stack and _current_celery_task_id to be empty
in worker threads. This broke OTel span parenting for parallel tool calls
(missing parent_event_id) and lost the Celery task ID in the enterprise
tracking layer ([Task ID: no-task]).

Fix by capturing an independent context copy per submission via
contextvars.copy_context().run in CrewAgentExecutor._handle_native_tool_calls,
so each worker thread starts with the correct inherited context without
sharing mutable state across threads.
2026-03-05 08:20:09 -05:00
Lorenze Jay
cebc52694e docs: update changelog and version for v1.10.1
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-03-04 18:20:02 -05:00
Lorenze Jay
53df41989a feat: bump versions to 1.10.1 (#4706)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
2026-03-04 11:03:17 -08:00
Greyson LaLonde
ea70976a5d fix: adjust executor listener value to avoid recursion (#4705)
* fix: adjust executor listener value to avoid recursion

* fix: clear call count to ensure zero state

* feat: expose max method call kwarg
2026-03-04 10:47:22 -08:00
João Moura
3cc6516ae5 Memory overall improvements (#4688)
* feat: enhance memory recall limits and update documentation

- Increased the memory recall limit in the Agent class from 5 to 15.
- Updated the RecallMemoryTool to allow a recall limit of 20.
- Expanded the documentation for the recall_memory feature to emphasize the importance of multiple queries for comprehensive results.

* feat: increase memory recall limit and enhance memory context documentation

- Increased the memory recall limit in the Agent class from 15 to 20.
- Updated the memory context message to clarify the nature of the memories presented and the importance of using the Search memory tool for comprehensive results.

* refactor: remove inferred_categories from RecallState and update category merging logic

- Removed the inferred_categories field from RecallState to simplify state management.
- Updated the _merged_categories method to only merge caller-supplied categories, enhancing clarity in category handling.

* refactor: simplify category handling in RecallFlow

- Updated the _merged_categories method to return only caller-supplied categories, removing the previous merging logic for inferred categories. This change enhances clarity and maintains consistency in category management.
2026-03-04 09:19:07 -08:00
nicoferdi96
ad82e52d39 fix(gemini): group parallel function_response parts in a single Content object (#4693)
* fix(gemini): group parallel function_response parts in a single Content object

When Gemini makes N parallel tool calls, the API requires all N function_response parts in one Content object. Previously each tool result created a separate Content, causing 400 INVALID_ARGUMENT errors. Merge consecutive function_response parts into the existing Content instead of appending new ones.

* Address change requested

- function_response is a declared field on the types.Part Pydantic model so hasattr can be replaced with p.function_response is not None
2026-03-04 12:04:23 +01:00
Matt Aitchison
9336702ebc fix(deps): bump pypdf, urllib3 override, and dev dependencies for security fixes
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
- pypdf ~6.7.4 → ~6.7.5 (CVE: inefficient ASCIIHexDecode stream decoding)
- Add urllib3>=2.6.3 override (CVE: decompression-bomb bypass on redirects)
- ruff 0.14.7 → 0.15.1, mypy 1.19.0 → 1.19.1, pre-commit 4.5.0 → 4.5.1
- types-regex 2024.11.6 → 2026.1.15, boto3-stubs 1.40.54 → 1.42.40
- Auto-fixed 13 lint issues from new ruff rules

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-03-04 01:13:38 -05:00
Greyson LaLonde
030f6d6c43 fix: use anon id for ephemeral traces 2026-03-04 00:45:09 -05:00
Mike Plachta
95d51db29f Langgraph migration guide (#4681)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
2026-03-03 11:53:12 -08:00
Greyson LaLonde
a8f51419f6 fix(gemini): surface thought output from thinking models
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
* fix(gemini): surface thought output from thinking models

* chore(llm): remove unreachable hasattr guards on crewai_event_bus
2026-03-03 11:54:55 -05:00
Greyson LaLonde
e7f17d2284 fix: load MCP and platform tools when agent tools is None
Closes #4568
2026-03-03 10:25:25 -05:00
Greyson LaLonde
5d0811258f fix(a2a): support Jupyter environments with running event loops 2026-03-03 10:05:48 -05:00
Greyson LaLonde
7972192d55 fix(deps): bump tokenizers lower bound to >=0.21 to avoid broken 0.20.3
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-03-02 18:04:28 -05:00
Mike Plachta
b3f8a42321 feat: upgrade gemini genai
Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
2026-03-02 14:27:56 -05:00
Greyson LaLonde
21224f2bc5 fix: conditionally pass plus header
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Empty strings are considered illegal values for bearer auth in `httpx`.
2026-03-02 09:27:54 -05:00
Giulio Leone
b76022c1e7 fix(telemetry): skip signal handler registration in non-main threads
* fix(telemetry): skip signal handler registration in non-main threads

When CrewAI is initialized from a non-main thread (e.g. Streamlit, Flask,
Django, Jupyter), the telemetry module attempted to register signal handlers
which only work in the main thread. This caused multiple noisy ValueError
tracebacks to be printed to stderr, confusing users even though the errors
were caught and non-fatal.

Check `threading.current_thread() is not threading.main_thread()` before
attempting signal registration, and skip silently with a debug-level log
message instead of printing full tracebacks.

Fixes crewAIInc/crewAI#4289

* fix(test): move Telemetry() inside signal.signal mock context

Refs: #4649

* fix(telemetry): move signal.signal mock inside thread to wrap Telemetry() construction

The patch context now activates inside init_in_thread so the mock
is guaranteed to be active before and during Telemetry.__init__,
addressing the Copilot review feedback.

Refs: #4289

* fix(test): mock logger.debug instead of capsys for deterministic assertion

Replace signal.signal-only mock with combined logger + signal mock.
Assert logger.debug was called with the skip message and signal.signal
was never invoked from the non-main thread.

Refs: #4289
2026-03-02 07:42:55 -05:00
Greyson LaLonde
1ac5801578 fix: inject tool errors as observations and resolve name collisions
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-03-01 00:46:04 -05:00
Matt Aitchison
c00a348837 fix: upgrade pypdf 4.x → 6.7.4 to resolve 11 Dependabot alerts
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
pypdf <6.7.4 has multiple DoS vulnerabilities via crafted PDF streams
(FlateDecode, LZWDecode, RunLengthDecode, XFA, TreeObject, outlines).

Only basic PdfReader/PdfWriter APIs are used in crewai-files, none of
which changed in the 5.0 or 6.0 breaking releases.
2026-02-28 17:16:45 -05:00
Matt Aitchison
6c8c6c8e12 fix: resolve critical/high Dependabot security alerts (#4652)
Upgrade pillow 10.4.0 → 12.1.1 (out-of-bounds write on PSD images),
langchain-core 0.3.76 → 0.3.83 (template injection), and
urllib3 2.6.1 → 2.6.3 (decompression-bomb bypass on redirects).

Bump docling ~=2.63.0 → ~=2.75.0 for pillow 12 compat, and add
uv overrides for pillow/langchain-core to unblock transitive pins
from fastembed and langchain-apify.
2026-02-28 13:04:35 -06:00
Musthaq Ahamad
3899910aa9 docs: sync Composio tool docs across locales (#4639)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
* docs: update Composio tool docs across locales

Align the Composio automation docs with the new session-based example flow and keep localized pages in sync with the updated English content.

Made-with: Cursor

* docs: clarify manual user authentication wording

Refine the Composio auth section language to reflect session-based automatic auth during agent chat while keeping the manual `authorize` flow explicit.

Made-with: Cursor

* docs: sync updated Composio auth wording across locales

Propagate the latest English wording updates for CrewAI provider initialization and manual user authentication guidance to pt-BR and ko docs.

Made-with: Cursor
2026-02-27 13:38:45 -08:00
Greyson LaLonde
757a435ee3 chore: update changelog and version for v1.10.1a1
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
2026-02-27 09:58:48 -05:00
Greyson LaLonde
8bfdb188f7 feat: bump versions to 1.10.1a1 2026-02-27 09:44:47 -05:00
João Moura
1bdb9496a3 refactor: update step callback methods to support asynchronous invocation (#4633)
* refactor: update step callback methods to support asynchronous invocation

- Replaced synchronous step callback invocations with asynchronous counterparts in the CrewAgentExecutor class.
- Introduced a new async method _ainvoke_step_callback to handle step callbacks in an async context, improving responsiveness and performance in asynchronous workflows.

* chore: bump version to 1.10.1b1 across multiple files

- Updated version strings from 1.10.1b to 1.10.1b1 in various project files including pyproject.toml and __init__.py files.
- Adjusted dependency specifications to reflect the new version in relevant templates and modules.
2026-02-27 07:35:03 -03:00
Joao Moura
979aa26c3d bump new alpha version 2026-02-27 01:43:33 -08:00
João Moura
514c082882 refactor: implement lazy loading for heavy dependencies in Memory module (#4632)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
- Introduced lazy imports for the Memory and EncodingFlow classes to optimize import time and reduce initial load, particularly beneficial for deployment scenarios like Celery pre-fork.
- Updated the Memory class to include new configuration options for aggregation queries, enhancing its functionality.
- Adjusted the __getattr__ method in both the crewai and memory modules to support lazy loading of specified attributes.
2026-02-27 03:20:02 -03:00
Greyson LaLonde
c9e8068578 docs: update changelog and version for v1.10.0 2026-02-26 19:14:25 -05:00
Greyson LaLonde
df2778f08b fix: make branch for release notes
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
2026-02-26 18:49:13 -05:00
Greyson LaLonde
d8fea2518d feat: bump versions to 1.10.0
* feat: bump versions to 1.10.0

* chore: update tool specifications

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
2026-02-26 18:31:14 -05:00
Lucas Gomide
d259150d8d Enhance MCP tool resolution and related events (#4580)
* feat: enhance MCP tool resolution

* feat: emit event when MCP configuration fails

* feat: emit event when MCP tool execution has failed

* style: resolve linter issues

* refactor: use clear and natural mcp tool name resolution

* test: fix broken tests

* fix: resolve MCP connection leaks, slug validation, duplicate connections, and httpx exception handling

---------

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
Co-authored-by: Greyson LaLonde <greyson@crewai.com>
2026-02-26 13:59:30 -08:00
Greyson LaLonde
c4a328c9d5 fix: validate tool kwargs even when empty to prevent cryptic TypeError (#4611) 2026-02-26 16:18:03 -05:00
Greyson LaLonde
373abbb6b7 fix: add dict overload to build_embedder and type default embedder 2026-02-26 16:04:28 -05:00
João Moura
86d3ee022d feat: update lancedb version and add lance-namespace packages
* chore(deps): update lancedb version and add lance-namespace packages

- Updated lancedb dependency version from 0.4.0 to 0.29.2 in multiple files.
- Added new packages: lance-namespace and lance-namespace-urllib3-client with version 0.5.2, including their dependencies and installation details.
- Enhanced MemoryTUI to display a limit on entries and improved the LanceDBStorage class with automatic background compaction and index creation for better performance.

* linter

* refactor: update memory recall limit and formatting in Agent class

- Reduced the memory recall limit from 10 to 5 in multiple locations within the Agent class.
- Updated the memory formatting to use a new `format` method in the MemoryMatch class for improved readability and metadata inclusion.

* refactor: enhance memory handling with read-only support

- Updated memory-related classes and methods to support read-only functionality, allowing for silent no-ops when attempting to remember data in read-only mode.
- Modified the LiteAgent and CrewAgentExecutorMixin classes to check for read-only status before saving memories.
- Adjusted MemorySlice and Memory classes to reflect changes in behavior when read-only is enabled.
- Updated tests to verify that memory operations behave correctly under read-only conditions.

* test: set mock memory to read-write in unit tests

- Updated unit tests in test_unified_memory.py to set mock_memory._read_only to False, ensuring that memory operations can be tested in a writable state.

* fix test

* fix: preserve falsy metadata values and fix remember() return type

---------

Co-authored-by: lorenzejay <lorenzejaytech@gmail.com>
Co-authored-by: Greyson LaLonde <greyson@crewai.com>
2026-02-26 15:05:10 -05:00
Lucas Gomide
09e3b81ca3 fix: preserve null types in tool parameter schemas for LLM (#4579)
* fix: preserve null types in tool parameter schemas for LLM

Tool parameter schemas were stripping null from optional fields via
generate_model_description, forcing the LLM to provide non-null values
for fields.
Adds strip_null_types parameter to generate_model_description and passes False when generating tool
schemas, so optional fields keep anyOf: [{type: T}, {type: null}]

* Update lib/crewai/src/crewai/utilities/pydantic_schema_utils.py

Co-authored-by: Gabe Milani <gabriel@crewai.com>

---------

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
Co-authored-by: Gabe Milani <gabriel@crewai.com>
Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
2026-02-26 11:51:34 -05:00
Heitor Carvalho
b6d8ce5c55 docs: add litellm dependency note for non-native LLM providers (#4600)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
2026-02-26 10:57:37 -03:00
Greyson LaLonde
b371f97a2f fix: map output_pydantic/output_json to native structured output
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* fix: map output_pydantic/output_json to native structured output

* test: add crew+tools+structured output integration test for Gemini

* fix: re-record stale cassette for test_crew_testing_function

* fix: re-record remaining stale cassettes for native structured output

* fix: enable native structured output for lite agent and fix mypy errors
2026-02-25 17:13:34 -05:00
dependabot[bot]
017189db78 chore(deps): bump nltk in the security-updates group across 1 directory (#4598)
Bumps the security-updates group with 1 update in the / directory: [nltk](https://github.com/nltk/nltk).


Updates `nltk` from 3.9.2 to 3.9.3
- [Changelog](https://github.com/nltk/nltk/blob/develop/ChangeLog)
- [Commits](https://github.com/nltk/nltk/compare/3.9.2...3.9.3)

---
updated-dependencies:
- dependency-name: nltk
  dependency-version: 3.9.3
  dependency-type: indirect
  dependency-group: security-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-25 15:37:21 -06:00
dependabot[bot]
02d911494f chore(deps): bump cryptography (#4506)
Bumps the security-updates group with 1 update in the / directory: [cryptography](https://github.com/pyca/cryptography).


Updates `cryptography` from 46.0.4 to 46.0.5
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/46.0.4...46.0.5)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 46.0.5
  dependency-type: indirect
  dependency-group: security-updates
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-25 15:04:07 -06:00
João Moura
8102d0a6ca feat: enhance JSON argument parsing and validation in CrewAgentExecutor and BaseTool
* feat: enhance JSON argument parsing and validation in CrewAgentExecutor and BaseTool

- Added error handling for malformed JSON tool arguments in CrewAgentExecutor, providing descriptive error messages.
- Implemented schema validation for tool arguments in BaseTool, ensuring that invalid arguments raise appropriate exceptions.
- Introduced tests to verify correct behavior for both valid and invalid JSON inputs, enhancing robustness of tool execution.

* refactor: improve argument validation in BaseTool

- Introduced a new private method  to handle argument validation for tools, enhancing code clarity and reusability.
- Updated the  method to utilize the new validation method, ensuring consistent error handling for invalid arguments.
- Enhanced exception handling to specifically catch , providing clearer error messages for tool argument validation failures.

* feat: introduce parse_tool_call_args for improved argument parsing

- Added a new utility function, parse_tool_call_args, to handle parsing of tool call arguments from JSON strings or dictionaries, enhancing error handling for malformed JSON inputs.
- Updated CrewAgentExecutor and AgentExecutor to utilize the new parsing function, streamlining argument validation and improving clarity in error reporting.
- Introduced unit tests for parse_tool_call_args to ensure robust functionality and correct handling of various input scenarios.

* feat: add keyword argument validation in BaseTool and Tool classes

- Introduced a new method `_validate_kwargs` in BaseTool to validate keyword arguments against the defined schema, ensuring proper argument handling.
- Updated the `run` and `arun` methods in both BaseTool and Tool classes to utilize the new validation method, improving error handling and robustness.
- Added comprehensive tests for asynchronous execution in `TestBaseToolArunValidation` to verify correct behavior for valid and invalid keyword arguments.

* Potential fix for pull request finding 'Syntax error'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

---------

Co-authored-by: lorenzejay <lorenzejaytech@gmail.com>
Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-02-25 13:13:31 -05:00
Greyson LaLonde
ee374d01de chore: add versioning logic for devtools 2026-02-25 12:13:00 -05:00
Greyson LaLonde
9914e51199 feat: add versioned docs
starting with 1.10.0
2026-02-25 11:05:31 -05:00
nicoferdi96
2dbb83ae31 Private package registry (#4583)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
adding reference and explaination for package registry

Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
2026-02-24 19:37:17 +01:00
Mike Plachta
7377e1aa26 fix: bedrock region was always set to "us-east-1" not respecting the env var. (#4582)
* fix: bedrock region was always set to "us-east-1" not respecting the env
var.

code had AWS_REGION_NAME referenced, but not used, unified to
AWS_DEFAULT_REGION as per documentation

* DRY code improvement and fix caught by tests.

* Supporting litellm configuration
2026-02-24 09:59:01 -08:00
Greyson LaLonde
51754899a2 feat: migrate CLI http client from requests to httpx
Some checks failed
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-02-20 18:21:05 -05:00
Greyson LaLonde
71b4f8402a fix: ensure callbacks are ran/awaited if promise
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
2026-02-20 13:15:50 -05:00
Greyson LaLonde
4a4c99d8a2 fix: capture method name in exception context
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-02-19 17:51:18 -05:00
Greyson LaLonde
28a6b855a2 fix: preserve enum type in router result; improve types 2026-02-19 17:30:47 -05:00
Lorenze Jay
d09656664d supporting parallel tool use (#4513)
* supporting parallel tool use

* ensure we respect max_usage_count

* ensure result_as_answer, hooks, and cache parodity

* improve crew agent executor

* address test comments
2026-02-19 14:07:28 -08:00
Lucas Gomide
49aa29bb41 docs: correct broken human_feedback examples with working self-loop patterns (#4520)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
2026-02-19 09:02:01 -08:00
João Moura
8df499d471 Fix cyclic flows silently breaking when persistence ID is passed in inputs (#4501)
Some checks failed
Mark stale issues and pull requests / stale (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
* Implement user input handling in Flow class

- Introduced `FlowInputRequestedEvent` and `FlowInputReceivedEvent` to manage user input requests and responses during flow execution.
- Added `InputProvider` protocol and `InputResponse` dataclass for customizable input handling.
- Enhanced `Flow` class with `ask()` method to request user input, including timeout handling and state checkpointing.
- Updated `FlowConfig` to support custom input providers.
- Created `input_provider.py` for default input provider implementations, including a console-based provider.
- Added comprehensive tests for `ask()` functionality, covering basic usage, timeout behavior, and integration with flow machinery.

* Potential fix for pull request finding 'Unused import'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Refactor test_flow_ask.py to streamline flow kickoff calls

- Removed unnecessary variable assignments for the result of `flow.kickoff()` in two test cases, improving code clarity.
- Updated assertions to ensure the expected execution log entries are present after the flow kickoff, enhancing test reliability.

* Add current_flow_method_name context variable for flow method tracking

- Introduced a new context variable, `current_flow_method_name`, to store the name of the currently executing flow method, defaulting to "unknown".
- Updated the Flow class to set and reset this context variable during method execution, enhancing the ability to track method calls without stack inspection.
- Removed the obsolete `_resolve_calling_method_name` method, streamlining the code and improving clarity.

* Enhance input history management in Flow class

- Introduced a new `InputHistoryEntry` TypedDict to structure user input history for the `ask()` method, capturing details such as the question, user response, method name, timestamp, and associated metadata.
- Updated the `_input_history` attribute in the Flow class to utilize the new `InputHistoryEntry` type, improving type safety and clarity in input history management.

* Enhance timeout handling in Flow class input requests

- Updated the `ask()` method to improve timeout management by manually managing the `ThreadPoolExecutor`, preventing potential deadlocks when the provider call exceeds the timeout duration.
- Added clarifications in the documentation regarding the behavior of the timeout and the underlying request handling, ensuring better understanding for users.

* Enhance memory reset functionality in CLI commands

- Introduced flow memory reset capabilities in the `reset_memories_command`, allowing for both crew and flow memory resets.
- Added a new utility function `_reset_flow_memory` to handle memory resets for individual flow instances, improving modularity and clarity.
- Updated the `get_flows` utility to discover flow instances from project files, enhancing the CLI's ability to manage flow states.
- Expanded test coverage to validate the new flow memory reset features, ensuring robust functionality and error handling.

* LINTER

* Fix resumption flag logic in Flow class and add regression test for cyclic flow persistence

- Updated the logic for setting the `_is_execution_resuming` flag to ensure it only activates when there are completed methods to replay, preventing incorrect suppression of cyclic re-execution during state reloads.
- Added a regression test to validate that cyclic router flows complete all iterations when persistence is enabled and an 'id' is passed in inputs, ensuring robust handling of flow execution in these scenarios.

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-02-18 03:27:24 -03:00
João Moura
84d57c7a24 Implement user input handling in Flows (#4490)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* Implement user input handling in Flow class
2026-02-16 18:41:03 -03:00
João Moura
4aedd58829 Enhance HITL self-loop functionality in human feedback integration tests (#4493)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
- Added tests to verify self-loop behavior in HITL routers, ensuring they can handle multiple rejections and immediate approvals.
- Implemented `test_hitl_self_loop_routes_back_to_same_method`, `test_hitl_self_loop_multiple_rejections`, and `test_hitl_self_loop_immediate_approval` to validate the expected execution order and outcomes.
- Updated the `or_()` listener to support looping back to the same method based on human feedback outcomes, improving flow control in complex scenarios.
2026-02-15 21:54:42 -05:00
João Moura
09e9229efc New Memory Improvements (#4484)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
* better DevEx

* Refactor: Update supported native providers and enhance memory handling

- Removed "groq" and "meta" from the list of supported native providers in `llm.py`.
- Added a safeguard in `flow.py` to ensure all background memory saves complete before returning.
- Improved error handling in `unified_memory.py` to prevent exceptions during shutdown, ensuring smoother memory operations and event bus interactions.

* Enhance Memory System with Consolidation and Learning Features

- Introduced memory consolidation mechanisms to prevent duplicate records during content saving, utilizing similarity checks and LLM decision-making.
- Implemented non-blocking save operations in the memory system, allowing agents to continue tasks while memory is being saved.
- Added support for learning from human feedback, enabling the system to distill lessons from past corrections and improve future outputs.
- Updated documentation to reflect new features and usage examples for memory consolidation and HITL learning.

* Enhance cyclic flow handling for or_() listeners

- Updated the Flow class to ensure that all fired or_() listeners are cleared between cycle iterations, allowing them to fire again in subsequent cycles. This change addresses a bug where listeners remained suppressed across iterations.
- Added regression tests to verify that or_() listeners fire correctly on every iteration in cyclic flows, ensuring expected behavior in complex routing scenarios.
2026-02-15 04:57:56 -03:00
João Moura
18d266c8e7 New Unified Memory System (#4420)
Some checks failed
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* chore: update memory management and dependencies

- Enhance the memory system by introducing a unified memory API that consolidates short-term, long-term, entity, and external memory functionalities.
- Update the `.gitignore` to exclude new memory-related files and blog directories.
- Modify `conftest.py` to handle missing imports for vcr stubs more gracefully.
- Add new development dependencies in `pyproject.toml` for testing and memory management.
- Refactor the `Crew` class to utilize the new unified memory system, replacing deprecated memory attributes.
- Implement memory context injection in `LiteAgent` to improve memory recall during agent execution.
- Update documentation to reflect changes in memory usage and configuration.

* feat: introduce Memory TUI for enhanced memory management

- Add a new command to the CLI for launching a Textual User Interface (TUI) to browse and recall memories.
- Implement the MemoryTUI class to facilitate user interaction with memory scopes and records.
- Enhance the unified memory API by adding a method to list records within a specified scope.
- Update `pyproject.toml` to include the `textual` dependency for TUI functionality.
- Ensure proper error handling for missing dependencies when accessing the TUI.

* feat: implement consolidation flow for memory management

- Introduce the ConsolidationFlow class to handle the decision-making process for inserting, updating, or deleting memory records based on new content.
- Add new data models: ConsolidationAction and ConsolidationPlan to structure the actions taken during consolidation.
- Enhance the memory types with new fields for consolidation thresholds and limits.
- Update the unified memory API to utilize the new consolidation flow for managing memory records.
- Implement embedding functionality for new content to facilitate similarity checks.
- Refactor existing memory analysis methods to integrate with the consolidation process.
- Update translations to include prompts for consolidation actions and user interactions.

* feat: enhance Memory TUI with Rich markup and improved UI elements

- Update the MemoryTUI class to utilize Rich markup for better visual representation of memory scope information.
- Introduce a color palette for consistent branding across the TUI interface.
- Refactor the CSS styles to improve the layout and aesthetics of the memory browsing experience.
- Enhance the display of memory entries, including better formatting for records and importance ratings.
- Implement loading indicators and error messages with Rich styling for improved user feedback during recall operations.
- Update the action bindings and navigation prompts for a more intuitive user experience.

* feat: enhance Crew class memory management and configuration

- Update the Crew class to allow for more flexible memory configurations by accepting Memory, MemoryScope, or MemorySlice instances.
- Refactor memory initialization logic to support custom memory configurations while maintaining backward compatibility.
- Improve documentation for memory-related fields to clarify usage and expectations.
- Introduce a recall oversample factor to optimize memory recall processes.
- Update related memory types and configurations to ensure consistency across the memory management system.

* chore: update dependency overrides and enhance memory management

- Added an override for the 'rich' dependency to allow compatibility with 'textual' requirements.
- Updated the 'pyproject.toml' and 'uv.lock' files to reflect the new dependency specifications.
- Refactored the Crew class to simplify memory configuration handling by allowing any type for the memory attribute.
- Improved error messages in the CLI for missing 'textual' dependency to guide users on installation.
- Introduced new packages and dependencies in the project to enhance functionality and maintain compatibility.

* refactor: enhance thread safety in flow management

- Updated LockedListProxy and LockedDictProxy to subclass list and dict respectively, ensuring compatibility with libraries requiring strict type checks.
- Improved documentation to clarify the purpose of these proxies and their thread-safe operations.
- Ensured that all mutations are protected by locks while reads delegate to the underlying data structures, enhancing concurrency safety.

* chore: update dependency versions and improve Python compatibility

- Downgraded 'vcrpy' dependency to version 7.0.0 for compatibility.
- Enhanced 'uv.lock' to include more granular resolution markers for Python versions and implementations, ensuring better compatibility across different environments.
- Updated 'urllib3' and 'selenium' dependencies to specify versions based on Python implementation, improving stability and performance.
- Removed deprecated resolution markers for 'fastembed' and streamlined its dependencies for better clarity.

* fix linter

* chore: update uv.lock for improved dependency management and memory management enhancements

- Incremented revision number in uv.lock to reflect changes.
- Added a new development dependency group in uv.lock, specifying versions for tools like pytest, mypy, and pre-commit to streamline development workflows.
- Enhanced error handling in CLI memory functions to provide clearer feedback on missing dependencies.
- Refactored memory management classes to improve type hints and maintainability, ensuring better compatibility with future updates.

* fix tests

* refactor: remove obsolete RAGStorage tests and clean up error handling

- Deleted outdated tests for RAGStorage that were no longer relevant, including tests for client failures, save operation failures, and reset failures.
- Cleaned up the test suite to focus on current functionality and improve maintainability.
- Ensured that remaining tests continue to validate the expected behavior of knowledge storage components.

* fix test

* fix texts

* fix tests

* forcing new commit

* fix: add location parameter to Google Vertex embedder configuration for memory integration tests

* debugging CI

* adding debugging for CI

* refactor: remove unnecessary logging for memory checks in agent execution

- Eliminated redundant logging statements related to memory checks in the Agent and CrewAgentExecutor classes.
- Simplified the memory retrieval logic by directly checking for available memory without logging intermediate states.
- Improved code readability and maintainability by reducing clutter in the logging output.

* udpating desp

* feat: enhance thread safety in LockedListProxy and LockedDictProxy

- Added equality comparison methods (__eq__ and __ne__) to LockedListProxy and LockedDictProxy to allow for safe comparison of their contents.
- Implemented consistent locking mechanisms to prevent deadlocks during comparisons.
- Improved the overall robustness of these proxy classes in multi-threaded environments.

* feat: enhance memory functionality in Flows documentation and memory system

- Added a new section on memory usage within Flows, detailing built-in methods for storing and recalling memories.
- Included an example of a Research and Analyze Flow demonstrating the integration of memory for accumulating knowledge over time.
- Updated the Memory documentation to clarify the unified memory system and its capabilities, including adaptive-depth recall and composite scoring.
- Introduced a new configuration parameter, `recall_oversample_factor`, to improve the effectiveness of memory retrieval processes.

* update docs

* refactor: improve memory record handling and pagination in unified memory system

- Simplified the `get_record` method in the Memory class by directly accessing the storage's `get_record` method.
- Enhanced the `list_records` method to include an `offset` parameter for pagination, allowing users to skip a specified number of records.
- Updated documentation for both methods to clarify their functionality and parameters, improving overall code clarity and usability.

* test: update memory scope assertions in unified memory tests

- Modified assertions in `test_lancedb_list_scopes_get_scope_info` and `test_memory_list_scopes_info_tree` to check for the presence of the "/team" scope instead of the root scope.
- Clarified comments to indicate that `list_scopes` returns child scopes rather than the root itself, enhancing test clarity and accuracy.

* feat: integrate memory tools for agents and crews

- Added functionality to inject memory tools into agents during initialization, enhancing their ability to recall and remember information mid-task.
- Implemented a new `_add_memory_tools` method in the Crew class to facilitate the addition of memory tools when memory is available.
- Introduced `RecallMemoryTool` and `RememberTool` classes in a new `memory_tools.py` file, providing agents with active recall and memory storage capabilities.
- Updated English translations to include descriptions for the new memory tools, improving user guidance on their usage.

* refactor: streamline memory recall functionality across agents and tools

- Removed the 'depth' parameter from memory recall calls in LiteAgent and Agent classes, simplifying the recall process.
- Updated the MemoryTUI to use 'deep' depth by default for more comprehensive memory retrieval.
- Enhanced the MemoryScope and MemorySlice classes to default to 'deep' depth, improving recall accuracy.
- Introduced a new 'recall_queries' field in QueryAnalysis to optimize semantic vector searches with targeted phrases.
- Updated documentation and comments to reflect changes in memory recall behavior and parameters.

* refactor: optimize memory management in flow classes

- Enhanced memory auto-creation logic in Flow class to prevent unnecessary Memory instance creation for internal flows (RecallFlow, ConsolidationFlow) by introducing a _skip_auto_memory flag.
- Removed the deprecated time_hints field from QueryAnalysis and replaced it with a more flexible time_filter field to better handle time-based queries.
- Updated documentation and comments to reflect changes in memory handling and query analysis structure, improving clarity and usability.

* updates tests

* feat: introduce EncodingFlow for enhanced memory encoding pipeline

- Added a new EncodingFlow class to orchestrate the encoding process for memory, integrating LLM analysis and embedding.
- Updated the Memory class to utilize EncodingFlow for saving content, improving the overall memory management and conflict resolution.
- Enhanced the unified memory module to include the new EncodingFlow in its public API, facilitating better memory handling.
- Updated tests to ensure proper functionality of the new encoding flow and its integration with existing memory features.

* refactor: optimize memory tool integration and recall flow

- Streamlined the addition of memory tools in the Agent class by using list comprehension for cleaner code.
- Enhanced the RecallFlow class to build task lists more efficiently with list comprehensions, improving readability and performance.
- Updated the RecallMemoryTool to utilize list comprehensions for formatting memory results, simplifying the code structure.
- Adjusted test assertions in LiteAgent to reflect the default behavior of memory recall depth, ensuring clarity in expected outcomes.

* Potential fix for pull request finding 'Empty except'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* chore: gen missing cassette

* fix

* test: enhance memory extraction test by mocking recall to prevent LLM calls

Updated the test for memory extraction to include a mock for the recall method, ensuring that the test focuses on the save path without invoking external LLM calls. This improves test reliability and clarity.

* refactor: enhance memory handling by adding agent role parameter

Updated memory storage methods across multiple classes to include an optional `agent_role` parameter, improving the context of stored memories. Additionally, modified the initialization of several flow classes to suppress flow events, enhancing performance and reducing unnecessary event triggers.

* feat: enhance agent memory functionality with recall and save mechanisms

Implemented memory context injection during agent kickoff, allowing for memory recall before execution and passive saving of results afterward. Added new methods to handle memory saving and retrieval, including error handling for memory operations. Updated the BaseAgent class to support dynamic memory resolution and improved memory record structure with source and privacy attributes for better provenance tracking.

* test

* feat: add utility method to simplify tools field in console formatter

Introduced a new static method `_simplify_tools_field` in the console formatter to transform the 'tools' field from full tool objects to a comma-separated string of tool names. This enhancement improves the readability of tool information in the output.

* refactor: improve lazy initialization of LLM and embedder in Memory class

Refactored the Memory class to implement lazy initialization for the LLM and embedder, ensuring they are only created when first accessed. This change enhances the robustness of the Memory class by preventing initialization failures when constructed without an API key. Additionally, updated error handling to provide clearer guidance for users on resolving initialization issues.

* refactor: consolidate memory saving methods for improved efficiency

Refactored memory handling across multiple classes to replace individual memory saving calls with a batch method, `remember_many`, enhancing performance and reducing redundancy. Updated related tools and schemas to support single and multiple item memory operations, ensuring a more streamlined interface for memory interactions. Additionally, improved documentation and test coverage for the new functionality.

* feat: enhance MemoryTUI with improved layout and entry handling

Updated the MemoryTUI class to incorporate a new vertical layout, adding an OptionList for displaying entries and enhancing the detail view for selected records. Introduced methods for populating entry and recall lists, improving user interaction and data presentation. Additionally, refined CSS styles for better visual organization and focus handling.

* fix test

* feat: inject memory tools into LiteAgent for enhanced functionality

Added logic to the LiteAgent class to inject memory tools if memory is configured, ensuring that memory tools are only added if they are not already present. This change improves the agent's capability to utilize memory effectively during execution.

* feat: add synchronous execution method to ConsolidationFlow for improved integration

Introduced a new `run_sync()` method in the ConsolidationFlow class to facilitate procedural execution of the consolidation pipeline without relying on asynchronous event loops. Updated the EncodingFlow class to utilize this method for conflict resolution, ensuring compatibility within its async context. This change enhances the flow's ability to manage memory records effectively during nested executions.

* refactor: update ConsolidationFlow and EncodingFlow for improved async handling

Removed the synchronous `run_sync()` method from ConsolidationFlow and refactored the consolidate method in EncodingFlow to be asynchronous. This change allows for direct awaiting of the ConsolidationFlow's kickoff method, enhancing compatibility within the async event loop and preventing nested asyncio.run() issues. Additionally, updated the execution plan to listen for multiple paths, streamlining the consolidation process.

* fix: update flow documentation and remove unused ConsolidationFlow

Corrected the comment in Flow class regarding internal flows, replacing "ConsolidationFlow" with "EncodingFlow". Removed the ConsolidationFlow class as it is no longer needed, streamlining the memory handling process. Updated related imports and ensured that the memory module reflects these changes, enhancing clarity and maintainability.

* feat: enhance memory handling with background saving and query analysis optimization

Implemented a background saving mechanism in the Memory class to allow non-blocking memory operations, improving performance during high-load scenarios. Added a query analysis threshold to skip LLM calls for short queries, optimizing recall efficiency. Updated related methods and documentation to reflect these changes, ensuring a more responsive and efficient memory management system.

* fix test

* fix test

* fix: handle synchronous fallback for save operations in Memory class

Updated the Memory class to implement a synchronous fallback mechanism for save operations when the background thread pool is shut down. This change ensures that late save requests still succeed, improving reliability in memory management during shutdown scenarios.

* feat: implement HITL learning features in human feedback decorator

Added support for learning from human feedback in the human feedback decorator. Introduced parameters to enable lesson distillation and pre-review of outputs based on past feedback. Updated related tests to ensure proper functionality of the learning mechanism, including memory interactions and default LLM usage.

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-02-13 21:34:37 -03:00
Chujiang
670cdcacaa chore: update template files to use modern type annotations 2026-02-13 09:30:58 -05:00
Greyson LaLonde
f7e3b4dbe0 chore: remove downstream sync
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-02-12 14:35:23 -05:00
Rip&Tear
0ecf5d1fb0 docs: clarify NL2SQL security model and hardening guidance (#4465)
Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-02-12 10:50:29 -08:00
Giovanni Vella
6c0fb7f970 fix broken tasks table
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Signed-off-by: Giovanni Vella <giovanni.vella98@gmail.com>
2026-02-12 10:55:40 -05:00
Greyson LaLonde
cde33fd981 feat: add yanked detection for version notes
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-02-11 23:31:06 -05:00
Lorenze Jay
2ed0c2c043 imp compaction (#4399)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
* imp compaction

* fix lint

* cassette gen

* cassette gen

* improve assert

* adding azure

* fix global docstring
2026-02-11 15:52:03 -08:00
Lorenze Jay
0341e5aee7 supporting prompt cache results show (#4447)
* supporting prompt cache

* droped azure tests

* fix tests

---------

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-02-11 14:07:15 -08:00
Mike Plachta
397d14c772 fix: correct CLI flag format from --skip-provider to --skip_provider (#4462)
Update documentation to use underscore instead of hyphen in the `--skip_provider` flag across all CLI command examples for consistency with actual CLI implementation.
2026-02-11 13:51:54 -08:00
Lucas Gomide
fc3e86e9a3 docs Adding 96 missing actions across 9 integrations (#4460)
* docs: add missing integration actions from OAuth config

Sync enterprise integration docs with crewai-oauth apps.js config.
Adds ~96 missing actions across 9 integrations:
- Google Contacts: 4 contact group actions
- Google Slides: 14 slide manipulation/content actions
- Microsoft SharePoint: 27 file, Excel, and Word actions
- Microsoft Excel: 2 actions (get_used_range_metadata, get_table_data)
- Microsoft Word: 2 actions (copy_document, move_document)
- Google Docs: 27 text formatting, table, and header/footer actions
- Microsoft Outlook: 7 message and calendar event actions
- Microsoft OneDrive: 5 path-based and discovery actions
- Microsoft Teams: 8 meeting, channel, and reply actions

* docs: add missing integration actions from OAuth config

Sync pt-BR enterprise integration docs with crewai-oauth apps.js config.
Adds ~96 missing actions across 9 integrations, translated to Portuguese:
- Google Contacts: 2 contact group actions
- Google Slides: 14 slide manipulation/content actions
- Microsoft SharePoint: 27 file, Excel, and Word actions
- Microsoft Excel: 2 actions (get_used_range_metadata, get_table_data)
- Microsoft Word: 2 actions (copy_document, move_document)
- Google Docs: 27 text formatting, table, and header/footer actions
- Microsoft Outlook: 7 message and calendar event actions
- Microsoft OneDrive: 5 path-based and discovery actions
- Microsoft Teams: 8 meeting, channel, and reply actions

* docs: add missing integration actions from OAuth config

Sync Korean enterprise integration docs with crewai-oauth apps.js config.
Adds ~96 missing actions across 9 integrations, translated to Korean:
- Google Contacts: 2 contact group actions
- Google Slides: 14 slide manipulation/content actions
- Microsoft SharePoint: 27 file, Excel, and Word actions
- Microsoft Excel: 2 actions (get_used_range_metadata, get_table_data)
- Microsoft Word: 2 actions (copy_document, move_document)
- Google Docs: 27 text formatting, table, and header/footer actions
- Microsoft Outlook: 7 message and calendar event actions
- Microsoft OneDrive: 5 path-based and discovery actions
- Microsoft Teams: 8 meeting, channel, and reply actions

---------

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-02-11 15:17:54 -05:00
Mike Plachta
2882df5daf replace old .cursorrules with AGENTS.md (#4451)
* chore: remove .cursorrules file
feat: add AGENTS.md file to any newly created file

* move the copy of the tests
2026-02-11 10:07:24 -08:00
Greyson LaLonde
3a22e80764 fix: ensure openai tool call stream is finalized
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
2026-02-11 10:02:31 -05:00
Greyson LaLonde
9b585a934d fix: pass started_event_id to crew 2026-02-11 09:30:07 -05:00
Rip&Tear
46e1b02154 chore: fix codeql coverage and action version (#4454) 2026-02-11 18:20:07 +08:00
Rip&Tear
87675b49fd test: avoid URL substring assertion in brave search test (#4453)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-02-11 14:32:10 +08:00
Lucas Gomide
a3bee66be8 Address OpenSSL CVE-2025-15467 vulnerability (#4426)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
* fix(security): bump regex from 2024.9.11 to 2026.1.15

Address security vulnerability flagged in regex==2024.9.11

* bump mcp from 1.23.1 to 1.26.0

Address security vulnerability flagged in mcp==1.16.0 (resolved to 1.23.3)
2026-02-10 09:39:35 -08:00
Greyson LaLonde
f6fa04528a fix: add async HITL support and chained-router tests
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
asynchronous human-in-the-loop handling and related fixes.

- Extend human_input provider with async support: AsyncExecutorContext, handle_feedback_async, async prompt helpers (_prompt_input_async, _async_readline), and async training/regular feedback loops in SyncHumanInputProvider.
- Add async handler methods in CrewAgentExecutor and AgentExecutor (_ahandle_human_feedback, _ainvoke_loop) to integrate async provider flows.
- Change PlusAPI.get_agent to an async httpx call and adapt caller in agent_utils to run it via asyncio.run.
- Simplify listener execution in flow.Flow to correctly pass HumanFeedbackResult to listeners and unify execution path for router outcomes.
- Remove deprecated types/hitl.py definitions.
- Add tests covering chained router feedback, rejected paths, and mixed router/non-router listeners to prevent regressions.
2026-02-06 16:29:27 -05:00
Greyson LaLonde
7d498b29be fix: event ordering; flow state locks, routing
* fix: add current task id context and flow updates

introduce a context var for the current task id in `crewai.context` to track task scope. update `Flow._execute_single_listener` to return `(result, event_id)` and adjust callers to unpack it and append `FlowMethodName(str(result))` to `router_results`. set/reset the current task id at the start/end of task execution (async + sync) with minor import and call-site tweaks.

* fix: await event futures and flush event bus

call `crewai_event_bus.flush()` after crew kickoff. in `Flow`, await event handler futures instead of just collecting them: await pending `_event_futures` before finishing, await emitted futures immediately with try/except to log failures, then clear `_event_futures`. ensures handlers complete and errors surface.

* fix: continue iteration on tool completion events

expand the loop bridge listener to also trigger on tool completion events (`tool_completed` and `native_tool_completed`) so agent iteration resumes after tools finish. add a `requests.post` mock and response fixture in the liteagent test to simulate platform tool execution. refresh and sanitize vcr cassettes (updated model responses, timestamps, and header placeholders) to reflect tool-call flows and new recordings.

* fix: thread-safe state proxies & native routing

add thread-safe state proxies and refactor native tool routing.

* introduce `LockedListProxy` and `LockedDictProxy` in `flow.py` and update `StateProxy` to return them for list/dict attrs so mutations are protected by the flow lock.
* update `AgentExecutor` to use `StateProxy` on flow init, guard the messages setter with the state lock, and return a `StateProxy` from the temp state accessor.
* convert `call_llm_native_tools` into a listener (no direct routing return) and add `route_native_tool_result` to route based on state (pending tool calls, final answer, or context error).
* minor cleanup in `continue_iteration` to drop orphan listeners on init.
* update test cassettes for new native tool call responses, timestamps, and ids.

improves concurrency safety for shared state and makes native tool routing explicit.

* chore: regen cassettes

* chore: regen cassettes, remove duplicate listener call path
2026-02-06 14:02:43 -05:00
Greyson LaLonde
1308bdee63 feat: add started_event_id and set in eventbus
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* feat: add started_event_id and set in eventbus

* chore: update additional test assumption

* fix: restore event bus handlers on context exit

fix rollback in crewai events bus so that exiting the context restores
the previous _sync_handlers, _async_handlers, _handler_dependencies, and _execution_plan_cache by assigning shallow copies of the saved dicts. previously these
were set to empty dicts on exit, which caused registered handlers and cached execution plans to be lost.
2026-02-05 21:28:23 -05:00
Greyson LaLonde
6bb1b178a1 chore: extension points
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Introduce ContextVar-backed hooks and small API/behavior changes to improve extensibility and testability.

Changes include:
- agents: mark configure_structured_output as abstract and change its parameter to task to reflect use of task metadata.
- tracing: convert _first_time_trace_hook to a ContextVar and call .get() to safely retrieve the hook.
- console formatter: add _disable_version_check ContextVar and skip version checks when set (avoids noisy checks in certain contexts).
- flow: use current_triggering_event_id variable when scheduling listener tasks to keep naming consistent.
- hallucination guardrail: make context optional, add _validate_output_hook to allow custom validation hooks, update examples and return contract to allow hooks to override behavior.
- agent utilities: add _create_plus_client_hook for injecting a Plus client (used in tests/alternate flows), ensure structured tools have current_usage_count initialized and propagate to original tool, and fall back to creating PlusAPI client when no hook is provided.
2026-02-05 12:49:54 -05:00
Greyson LaLonde
fe2a4b4e40 chore: bug fixes and more refactor
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Refactor agent executor to delegate human interactions to a provider: add messages and ask_for_human_input properties, implement _invoke_loop and _format_feedback_message, and replace the internal iterative/training feedback logic with a call to get_provider().handle_feedback.

Make LLMGuardrail kickoff coroutine-aware by detecting coroutines and running them via asyncio.run so both sync and async agents are supported.

Make telemetry more robust by safely handling missing task.output (use empty string) and returning early if span is None before setting attributes.

Improve serialization to detect circular references via an _ancestors set, propagate it through recursive calls, and pass exclude/max_depth/_current_depth consistently to prevent infinite recursion and produce stable serializable output.
2026-02-04 21:21:54 -05:00
Greyson LaLonde
711e7171e1 chore: improve hook typing and registration
Allow hook registration to accept both typed hook types and plain callables by importing and using After*/Before*CallHookCallable types; add explicit LLMCallHookContext and ToolCallHookContext typing in crew_base. Introduce a post-initialize crew hook list and invoke hooks after Crew instance initialization. Refactor filtered hook factory functions to include precise typing and clearer local names (before_llm_hook/after_llm_hook/before_tool_hook/after_tool_hook) and register those with the instance. Update CrewInstance protocol to include _registered_hook_functions and _hooks_being_registered fields.
2026-02-04 21:16:20 -05:00
Vini Brasil
76b5f72e81 Fix tool error causing double event scope pop (#4373)
When a tool raises an error, both ToolUsageErrorEvent and
ToolUsageFinishedEvent were being emitted. Since both events pop the
event scope stack, this caused the agent scope to be incorrectly popped
along with the tool scope.
2026-02-04 20:34:08 -03:00
Greyson LaLonde
d86d43d3e0 chore: refactor crew to provider
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Enable dynamic extension exports and small behavior fixes across events and flow modules:

- events/__init__.py: Added _extension_exports and extended __getattr__ to lazily resolve registered extension values or import paths.
- events/event_bus.py: Implemented off() to unregister sync/async handlers, clean handler dependencies, and invalidate execution plan cache.
- events/listeners/tracing/utils.py: Added Callable import and _first_time_trace_hook to allow overriding first-time trace auto-collection behavior.
- events/types/tool_usage_events.py: Changed ToolUsageEvent.run_attempts default from None to 0 to avoid nullable handling.
- events/utils/console_formatter.py: Respect CREWAI_DISABLE_VERSION_CHECK env var to skip version checks in CI-like flows.
- flow/async_feedback/__init__.py: Added typing.Any import, _extension_exports and __getattr__ to support extensions via attribute lookup.

These changes add extension points and safer defaults, and provide a way to unregister event handlers.
2026-02-04 16:05:21 -05:00
Greyson LaLonde
6bfc98e960 refactor: extract hitl to provider pattern
* refactor: extract hitl to provider pattern

- add humaninputprovider protocol with setup_messages and handle_feedback
- move sync hitl logic from executor to synchuman inputprovider
- add _passthrough_exceptions extension point in agent/core.py
- create crewai.core.providers module for extensible components
- remove _ask_human_input from base_agent_executor_mixin
2026-02-04 15:40:22 -05:00
Greyson LaLonde
3cc33ef6ab fix: resolve complex schema $ref pointers in mcp tools
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* fix: resolve complex schema $ref pointers in mcp tools

* chore: update tool specifications

* fix: adapt mcp tools; sanitize pydantic json schemas

* fix: strip nulls from json schemas and simplify mcp args

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-03 20:47:58 -05:00
Lorenze Jay
3fec4669af Lorenze/fix/anthropic available functions call (#4360)
* feat: enhance AnthropicCompletion to support available functions in tool execution

- Updated the `_prepare_completion_params` method to accept `available_functions` for better tool handling.
- Modified tool execution logic to directly return results from tools when `available_functions` is provided, aligning behavior with OpenAI's model.
- Added new test cases to validate the execution of tools with available functions, ensuring correct argument passing and result formatting.

This change improves the flexibility and usability of the Anthropic LLM integration, allowing for more complex interactions with tools.

* refactor: remove redundant event emission in AnthropicCompletion

* fix test

* dry up
2026-02-03 16:30:43 -08:00
dependabot[bot]
d3f424fd8f chore(deps-dev): bump types-aiofiles
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Bumps [types-aiofiles](https://github.com/typeshed-internal/stub_uploader) from 24.1.0.20250822 to 25.1.0.20251011.
- [Commits](https://github.com/typeshed-internal/stub_uploader/commits)

---
updated-dependencies:
- dependency-name: types-aiofiles
  dependency-version: 25.1.0.20251011
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-03 12:02:28 -05:00
Matt Aitchison
fee9445067 fix: add .python-version to fix Dependabot uv updates (#4352)
Dependabot's uv updater defaults to Python 3.14.2, which is incompatible
with the project's requires-python constraint (>=3.10, <3.14). Adding
.python-version pins the Python version to 3.13 for dependency updates.

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-02-03 10:55:01 -06:00
Greyson LaLonde
a3c01265ee feat: add version check & integrate update notices 2026-02-03 10:17:50 -05:00
Matt Aitchison
aa7e7785bc chore: group dependabot security updates into single PR (#4351)
Configure dependabot to batch security updates together while keeping
regular version updates as separate PRs.
2026-02-03 08:53:28 -06:00
Thiago Moretto
e30645e855 limit stagehand dep version to 0.5.9 due breaking changes (#4339)
* limit to 0.5.9 due breaking changes + add env vars requirements

* fix tool spec extract that was ignoring with default

* original tool spec

* update spec
2026-02-03 09:43:24 -05:00
Greyson LaLonde
c1d2801be2 fix: reject reserved script names for crew folders 2026-02-03 09:16:55 -05:00
Greyson LaLonde
6a8483fcb6 fix: resolve race condition in guardrail event emission test 2026-02-03 09:06:48 -05:00
Greyson LaLonde
5fb602dff2 fix: replace timing-based concurrency test with state tracking 2026-02-03 08:58:51 -05:00
Greyson LaLonde
b90cff580a fix: relax openai and litellm dependency constraints 2026-02-03 08:51:55 -05:00
Vini Brasil
576b74b2ef Add call_id to LLM events for correlating requests (#4281)
When monitoring LLM events, consumers need to know which events belong
to the same API call. Before this change, there was no way to correlate
LLMCallStartedEvent, LLMStreamChunkEvent, and LLMCallCompletedEvent
belonging to the same request.
2026-02-03 10:10:33 -03:00
Greyson LaLonde
7590d4c6e3 fix: enforce additionalProperties=false in schemas
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* fix: enforce additionalProperties=false in schemas

* fix: ensure nested items have required properties
2026-02-02 22:19:04 -05:00
Sampson
8c6436234b adds additional search params (#4321)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Introduces support for additional Brave Search API web-search parameters.
2026-02-02 11:17:02 -08:00
Lucas Gomide
96bde4510b feat: auto update tools.specs (#4341) 2026-02-02 12:52:00 -05:00
Greyson LaLonde
9d7f45376a fix: use contextvars for flow execution context 2026-02-02 11:24:02 -05:00
Thiago Moretto
536447ab0e declare stagehand package as dep for StagehandTool (#4336) 2026-02-02 09:45:47 -05:00
Lorenze Jay
63a508f601 feat: bump versions to 1.9.3 (#4316)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
* feat: bump versions to 1.9.3

* bump bump
2026-01-30 14:24:25 -08:00
Greyson LaLonde
102b6ae855 feat: add a2a liteagent, auth, transport negotiation, and file support
* feat: add server-side auth schemes and protocol extensions

- add server auth scheme base class and implementations (api key, bearer token, basic/digest auth, mtls)
- add server-side extension system for a2a protocol extensions
- add extensions middleware for x-a2a-extensions header management
- add extension validation and registry utilities
- enhance auth utilities with server-side support
- add async intercept method to match client call interceptor protocol
- fix type_checking import to resolve mypy errors with a2aconfig

* feat: add transport negotiation and content type handling

- add transport negotiation logic with fallback support
- add content type parser and encoder utilities
- add transport configuration models (client and server)
- add transport types and enums
- enhance config with transport settings
- add negotiation events for transport and content type

* feat: add a2a delegation support to LiteAgent

* feat: add file input support to a2a delegation and tasks

Introduces handling of file inputs in A2A delegation flows by converting file dictionaries to protocol-compatible parts and propagating them through delegation and task execution functions. Updates include utility functions for file conversion, changes to message construction, and passing input_files through relevant APIs.

* feat: liteagent a2a delegation support to kickoff methods
2026-01-30 17:10:00 -05:00
Lorenze Jay
19ce56032c fix: improve output handling and response model integration in agents (#4307)
* fix: improve output handling and response model integration in agents

- Refactored output handling in the Agent class to ensure proper conversion and formatting of outputs, including support for BaseModel instances.
- Enhanced the AgentExecutor class to correctly utilize response models during execution, improving the handling of structured outputs.
- Updated the Gemini and Anthropic completion providers to ensure compatibility with new response model handling, including the addition of strict mode for function definitions.
- Improved the OpenAI completion provider to enforce strict adherence to function schemas.
- Adjusted translations to clarify instructions regarding output formatting and schema adherence.

* drop what was a print that didnt get deleted properly

* fixes gemini

* azure working

* bedrock works

* added tests

* adjust test

* fix tests and regen

* fix tests and regen

* refactor: ensure stop words are applied correctly in Azure, Gemini, and OpenAI completions; add tests to validate behavior with structured outputs

* linting
2026-01-30 12:27:46 -08:00
Joao Moura
85f31459c1 docs link
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
2026-01-30 09:05:36 -08:00
Joao Moura
6fcf748dae refactor: update Flow HITL Management documentation to emphasize email-first notifications, routing rules, and auto-response capabilities; remove outdated references to assignment and SLA management 2026-01-30 08:44:54 -08:00
Joao Moura
38065e29ce updating docs 2026-01-30 08:44:54 -08:00
Lorenze Jay
e291a97bdd chore: update version to 1.9.2 across all relevant files (#4299)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-01-28 17:11:44 -08:00
Lorenze Jay
2d05e59223 Lorenze/improve tool response pt2 (#4297)
* no need post tool reflection on native tools

* refactor: update prompt generation to prevent thought leakage

- Modified the prompt structure to ensure agents without tools use a simplified format, avoiding ReAct instructions.
- Introduced a new 'task_no_tools' slice for agents lacking tools, ensuring clean output without Thought: prefixes.
- Enhanced test coverage to verify that prompts do not encourage thought leakage, ensuring outputs remain focused and direct.
- Added integration tests to validate that real LLM calls produce clean outputs without internal reasoning artifacts.

* dont forget the cassettes
2026-01-28 16:53:19 -08:00
Greyson LaLonde
a731efac8d fix: improve structured output handling across providers and agents
- add gemini 2.0 schema support using response_json_schema with propertyordering while retaining backward compatibility for earlier models
- refactor llm completions to return validated pydantic models when a response_model is provided, updating hooks, types, and tests for consistent structured outputs
- extend agentfinish and executors to support basemodel outputs, improve anthropic structured parsing, and clean up schema utilities, tests, and original_json handling
2026-01-28 16:59:55 -05:00
Greyson LaLonde
1e27cf3f0f fix: ensure verbosity flag is applied
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
2026-01-28 11:52:47 -05:00
Lorenze Jay
381ad3a9a8 chore: update version to 1.9.1
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-01-27 20:08:53 -05:00
Lorenze Jay
f53bdb28ac feat: implement before and after tool call hooks in CrewAgentExecutor… (#4287)
* feat: implement before and after tool call hooks in CrewAgentExecutor and AgentExecutor

- Added support for before and after tool call hooks in both CrewAgentExecutor and AgentExecutor classes.
- Introduced ToolCallHookContext to manage context for hooks, allowing for enhanced control over tool execution.
- Implemented logic to block tool execution based on before hooks and to modify results based on after hooks.
- Added integration tests to validate the functionality of the new hooks, ensuring they work as expected in various scenarios.
- Enhanced the overall flexibility and extensibility of tool interactions within the CrewAI framework.

* Potential fix for pull request finding 'Unused local variable'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* Potential fix for pull request finding 'Unused local variable'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* test: add integration test for before hook blocking tool execution in Crew

- Implemented a new test to verify that the before hook can successfully block the execution of a tool within a crew.
- The test checks that the tool is not executed when the before hook returns False, ensuring proper control over tool interactions.
- Enhanced the validation of hook calls to confirm that both before and after hooks are triggered appropriately, even when execution is blocked.
- This addition strengthens the testing coverage for tool call hooks in the CrewAI framework.

* drop unused

* refactor(tests): remove OPENAI_API_KEY check from tool hook tests

- Eliminated the check for the OPENAI_API_KEY environment variable in the test cases for tool hooks.
- This change simplifies the test setup and allows for running tests without requiring the API key to be set, improving test accessibility and flexibility.

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-01-27 14:56:50 -08:00
Greyson LaLonde
3b17026082 fix: correct tool-calling content handling and schema serialization
- fix(gemini): prevent tool calls from using stale text content; correct key refs
- fix(agent-executor): resolve type errors
- refactor(schema): extract Pydantic schema utilities from platform tools
- fix(schema): properly serialize schemas and ensure Responses API uses a separate structure
- fix: preserve list identity to avoid mutation/aliasing issues
- chore(tests): update assumptions to match new behavior
2026-01-27 15:47:29 -05:00
Greyson LaLonde
d52dbc1f4b chore: add missing change logs (#4285)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* chore: add missing change logs

* chore: add translations
2026-01-26 18:26:01 -08:00
Lorenze Jay
6b926b90d0 chore: update version to 1.9.0 across all relevant files (#4284)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
- Bumped the version number to 1.9.0 in pyproject.toml files and __init__.py files across the CrewAI library and its tools.
- Updated dependencies to use the new version of crewai-tools (1.9.0) for improved functionality and compatibility.
- Ensured consistency in versioning across the codebase to reflect the latest updates.
2026-01-26 16:36:35 -08:00
Lorenze Jay
fc84daadbb fix: enhance file store with fallback memory cache when aiocache is n… (#4283)
* fix: enhance file store with fallback memory cache when aiocache is not installed

- Added a simple in-memory cache implementation to serve as a fallback when the aiocache library is unavailable.
- Improved error handling for the aiocache import, ensuring that the application can still function without it.
- This change enhances the robustness of the file store utility by providing a reliable caching mechanism in various environments.

* drop fallback

* Potential fix for pull request finding 'Unused global variable'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-01-26 15:12:34 -08:00
Lorenze Jay
58b866a83d Lorenze/supporting vertex embeddings (#4282)
* feat: introduce GoogleGenAIVertexEmbeddingFunction for dual SDK support

- Added a new embedding function to support both the legacy vertexai.language_models SDK and the new google-genai SDK for Google Vertex AI.
- Updated factory methods to route to the new embedding function.
- Enhanced VertexAIProvider and related configurations to accommodate the new model options.
- Added integration tests for Google Vertex embeddings with Crew memory, ensuring compatibility and functionality with both authentication methods.

This update improves the flexibility and compatibility of Google Vertex AI embeddings within the CrewAI framework.

* fix test count

* rm comment

* regen cassettes

* regen

* drop variable from .envtest

* dreict to relevant trest only
2026-01-26 14:55:03 -08:00
Greyson LaLonde
9797567342 feat: add structured outputs and response_format support across providers (#4280)
* feat: add response_format parameter to Azure and Gemini providers

* feat: add structured outputs support to Bedrock and Anthropic providers

* chore: bump anthropic dep

* fix: use beta structured output for new models
2026-01-26 11:03:33 -08:00
Greyson LaLonde
a32de6bdac fix: ensure doc list is not empty
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
2026-01-26 05:08:01 -05:00
Vidit Ostwal
06a58e463c feat: adding response_id in streaming response 2026-01-26 04:20:04 -05:00
Vidit Ostwal
3d771f03fa fix: ensure bedrock client handles stop sequences properly
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-01-25 20:28:09 -05:00
Greyson LaLonde
db7aeb5a00 chore: disable chroma telemetry
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
2026-01-25 16:23:29 -05:00
Lorenze Jay
0cb40374de Enhance Gemini LLM Tool Handling and Add Test for Float Responses (#4273)
- Updated the GeminiCompletion class to handle non-dict values returned from tools, ensuring that floats are wrapped in a dictionary format for consistent response handling.
- Introduced a new YAML cassette to test the Gemini LLM's ability to process tools that return float values, verifying that the agent can correctly utilize the sum_numbers tool and return the expected results.
- Added a comprehensive test case to validate the integration of the sum_numbers tool within the Gemini LLM, ensuring accurate calculations and proper response formatting.

These changes improve the robustness of tool interactions within the Gemini LLM and enhance testing coverage for float return values.

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-01-25 12:50:49 -08:00
Greyson LaLonde
0f3208197f chore: native files and openai responses docs
Some checks failed
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-01-23 18:24:00 -05:00
Greyson LaLonde
c4c9208229 feat: native multimodal file handling; openai responses api
- add input_files parameter to Crew.kickoff(), Flow.kickoff(), Task, and Agent.kickoff()
- add provider-specific file uploaders for OpenAI, Anthropic, Gemini, and Bedrock
- add file type detection, constraint validation, and automatic format conversion
- add URL file source support for multimodal content
- add streaming uploads for large files
- add prompt caching support for Anthropic
- add OpenAI Responses API support
2026-01-23 15:13:25 -05:00
Lorenze Jay
bd4d039f63 Lorenze/imp/native tool calling (#4258)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* wip restrcuturing agent executor and liteagent

* fix: handle None task in AgentExecutor to prevent errors

Added a check to ensure that if the task is None, the method returns early without attempting to access task properties. This change improves the robustness of the AgentExecutor by preventing potential errors when the task is not set.

* refactor: streamline AgentExecutor initialization by removing redundant parameters

Updated the Agent class to simplify the initialization of the AgentExecutor by removing unnecessary task and crew parameters in standalone mode. This change enhances code clarity and maintains backward compatibility by ensuring that the executor is correctly configured without redundant assignments.

* wip: clean

* ensure executors work inside a flow due to flow in flow async structure

* refactor: enhance agent kickoff preparation by separating common logic

Updated the Agent class to introduce a new private method  that consolidates the common setup logic for both synchronous and asynchronous kickoff executions. This change improves code clarity and maintainability by reducing redundancy in the kickoff process, while ensuring that the agent can still execute effectively within both standalone and flow contexts.

* linting and tests

* fix test

* refactor: improve test for Agent kickoff parameters

Updated the test for the Agent class to ensure that the kickoff method correctly preserves parameters. The test now verifies the configuration of the agent after kickoff, enhancing clarity and maintainability. Additionally, the test for asynchronous kickoff within a flow context has been updated to reflect the Agent class instead of LiteAgent.

* refactor: update test task guardrail process output for improved validation

Refactored the test for task guardrail process output to enhance the validation of the output against the OpenAPI schema. The changes include a more structured request body and updated response handling to ensure compliance with the guardrail requirements. This update aims to improve the clarity and reliability of the test cases, ensuring that task outputs are correctly validated and feedback is appropriately provided.

* test fix cassette

* test fix cassette

* working

* working cassette

* refactor: streamline agent execution and enhance flow compatibility

Refactored the Agent class to simplify the execution method by removing the event loop check and clarifying the behavior when called from synchronous and asynchronous contexts. The changes ensure that the method operates seamlessly within flow methods, improving clarity in the documentation. Additionally, updated the AgentExecutor to set the response model to None, enhancing flexibility. New test cassettes were added to validate the functionality of agents within flow contexts, ensuring robust testing for both synchronous and asynchronous operations.

* fixed cassette

* Enhance Flow Execution Logic

- Introduced conditional execution for start methods in the Flow class.
- Unconditional start methods are prioritized during kickoff, while conditional starts are executed only if no unconditional starts are present.
- Improved handling of cyclic flows by allowing re-execution of conditional start methods triggered by routers.
- Added checks to continue execution chains for completed conditional starts.

These changes improve the flexibility and control of flow execution, ensuring that the correct methods are triggered based on the defined conditions.

* Enhance Agent and Flow Execution Logic

- Updated the Agent class to automatically detect the event loop and return a coroutine when called within a Flow, simplifying async handling for users.
- Modified Flow class to execute listeners sequentially, preventing race conditions on shared state during listener execution.
- Improved handling of coroutine results from synchronous methods, ensuring proper execution flow and state management.

These changes enhance the overall execution logic and user experience when working with agents and flows in CrewAI.

* Enhance Flow Listener Logic and Agent Imports

- Updated the Flow class to track fired OR listeners, ensuring that multi-source OR listeners only trigger once during execution. This prevents redundant executions and improves flow efficiency.
- Cleared fired OR listeners during cyclic flow resets to allow re-execution in new cycles.
- Modified the Agent class imports to include Coroutine from collections.abc, enhancing type handling for asynchronous operations.

These changes improve the control and performance of flow execution in CrewAI, ensuring more predictable behavior in complex scenarios.

* adjusted test due to new cassette

* ensure native tool calling works with liteagent

* ensure response model is respected

* Enhance Tool Name Handling for LLM Compatibility

- Added a new function  to replace invalid characters in function names with underscores, ensuring compatibility with LLM providers.
- Updated the  function to sanitize tool names before validation.
- Modified the  function to use sanitized names for tool registration.

These changes improve the robustness of tool name handling, preventing potential issues with invalid characters in function names.

* ensure we dont finalize batch on just a liteagent finishing

* max tools per turn wip and ensure we drop print times

* fix sync main issues

* fix llm_call_completed event serialization issue

* drop max_tools_iterations

* for fixing model dump with state

* Add extract_tool_call_info function to handle various tool call formats

- Introduced a new utility function  to extract tool call ID, name, and arguments from different provider formats (OpenAI, Gemini, Anthropic, and dictionary).
- This enhancement improves the flexibility and compatibility of tool calls across multiple LLM providers, ensuring consistent handling of tool call information.
- The function returns a tuple containing the call ID, function name, and function arguments, or None if the format is unrecognized.

* Refactor AgentExecutor to support batch execution of native tool calls

- Updated the  method to process all tools from  in a single batch, enhancing efficiency and reducing the number of interactions with the LLM.
- Introduced a new utility function  to streamline the extraction of tool call details, improving compatibility with various tool formats.
- Removed the  parameter, simplifying the initialization of the .
- Enhanced logging and message handling to provide clearer insights during tool execution.
- This refactor improves the overall performance and usability of the agent execution flow.

* Update English translations for tool usage and reasoning instructions

- Revised the `post_tool_reasoning` message to clarify the analysis process after tool usage, emphasizing the need to provide only the final answer if requirements are met.
- Updated the `format` message to simplify the instructions for deciding between using a tool or providing a final answer, enhancing clarity for users.
- These changes improve the overall user experience by providing clearer guidance on task execution and response formatting.

* fix

* fixing azure tests

* organizae imports

* dropped unused

* Remove debug print statements from AgentExecutor to clean up the code and improve readability. This change enhances the overall performance of the agent execution flow by eliminating unnecessary console output during LLM calls and iterations.

* linted

* updated cassette

* regen cassette

* revert crew agent executor

* adjust cassettes and dropped tests due to native tool implementation

* adjust

* ensure we properly fail tools and emit their events

* Enhance tool handling and delegation tracking in agent executors

- Implemented immediate return for tools with result_as_answer=True in crew_agent_executor.py.
- Added delegation tracking functionality in agent_utils.py to increment delegations when specific tools are used.
- Updated tool usage logic to handle caching more effectively in tool_usage.py.
- Enhanced test cases to validate new delegation features and tool caching behavior.

This update improves the efficiency of tool execution and enhances the delegation capabilities of agents.

* Enhance tool handling and delegation tracking in agent executors

- Implemented immediate return for tools with result_as_answer=True in crew_agent_executor.py.
- Added delegation tracking functionality in agent_utils.py to increment delegations when specific tools are used.
- Updated tool usage logic to handle caching more effectively in tool_usage.py.
- Enhanced test cases to validate new delegation features and tool caching behavior.

This update improves the efficiency of tool execution and enhances the delegation capabilities of agents.

* fix cassettes

* fix

* regen cassettes

* regen gemini

* ensure we support bedrock

* supporting bedrock

* regen azure cassettes

* Implement max usage count tracking for tools in agent executors

- Added functionality to check if a tool has reached its maximum usage count before execution in both crew_agent_executor.py and agent_executor.py.
- Enhanced error handling to return a message when a tool's usage limit is reached.
- Updated tool usage logic in tool_usage.py to increment usage counts and print current usage status.
- Introduced tests to validate max usage count behavior for native tool calling, ensuring proper enforcement and tracking.

This update improves tool management by preventing overuse and providing clear feedback when limits are reached.

* fix other test

* fix test

* drop logs

* better tests

* regen

* regen all azure cassettes

* regen again placeholder for cassette matching

* fix: unify tool name sanitization across codebase

* fix: include tool role messages in save_last_messages

* fix: update sanitize_tool_name test expectations

Align test expectations with unified sanitize_tool_name behavior
that lowercases and splits camelCase for LLM provider compatibility.

* fix: apply sanitize_tool_name consistently across codebase

Unify tool name sanitization to ensure consistency between tool names
shown to LLMs and tool name matching/lookup logic.

* regen

* fix: sanitize tool names in native tool call processing

- Update extract_tool_call_info to return sanitized tool names
- Fix delegation tool name matching to use sanitized names
- Add sanitization in crew_agent_executor tool call extraction
- Add sanitization in experimental agent_executor
- Add sanitization in LLM.call function lookup
- Update streaming utility to use sanitized names
- Update base_agent_executor_mixin delegation check

* Extract text content from parts directly to avoid warning about non-text parts

* Add test case for Gemini token usage tracking

- Introduced a new YAML cassette for tracking token usage in Gemini API responses.
- Updated the test for Gemini to validate token usage metrics and response content.
- Ensured proper integration with the Gemini model and API key handling.

---------

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-01-22 17:44:03 -08:00
Vini Brasil
06d953bf46 Add model field to LLM failed events (#4267)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Move the `model` field from `LLMCallStartedEvent` and
`LLMCallCompletedEvent` to the base `LLMEventBase` class.
2026-01-22 16:19:18 +01:00
Greyson LaLonde
f997b73577 fix: bump mcp to ~=1.23.1
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
- resolves [cve](https://nvd.nist.gov/vuln/detail/CVE-2025-66416)
2026-01-21 12:43:48 -05:00
Greyson LaLonde
7a65baeb9c feat: add event ordering and parent-child hierarchy
adds emission sequencing, parent-child event hierarchy with scope management, and integrates both into the event bus. introduces flush() for deterministic handling, resets emission counters for test isolation, and adds chain tracking via previous_event_id/triggered_by_event_id plus context variables populated during emit and listener execution. includes tracing listener typing/sorting improvements, safer tool event pairing with try/finally, additional stack checks and cache-hit formatting, context isolation fixes, cassette regen/decoding, and test updates to handle vcr race conditions and flaky behavior.
2026-01-21 11:12:10 -05:00
Lorenze Jay
741bf12bf4 Lorenze/enh decouple executor from crew (#4209)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* wip restrcuturing agent executor and liteagent

* fix: handle None task in AgentExecutor to prevent errors

Added a check to ensure that if the task is None, the method returns early without attempting to access task properties. This change improves the robustness of the AgentExecutor by preventing potential errors when the task is not set.

* refactor: streamline AgentExecutor initialization by removing redundant parameters

Updated the Agent class to simplify the initialization of the AgentExecutor by removing unnecessary task and crew parameters in standalone mode. This change enhances code clarity and maintains backward compatibility by ensuring that the executor is correctly configured without redundant assignments.

* ensure executors work inside a flow due to flow in flow async structure

* refactor: enhance agent kickoff preparation by separating common logic

Updated the Agent class to introduce a new private method  that consolidates the common setup logic for both synchronous and asynchronous kickoff executions. This change improves code clarity and maintainability by reducing redundancy in the kickoff process, while ensuring that the agent can still execute effectively within both standalone and flow contexts.

* linting and tests

* fix test

* refactor: improve test for Agent kickoff parameters

Updated the test for the Agent class to ensure that the kickoff method correctly preserves parameters. The test now verifies the configuration of the agent after kickoff, enhancing clarity and maintainability. Additionally, the test for asynchronous kickoff within a flow context has been updated to reflect the Agent class instead of LiteAgent.

* refactor: update test task guardrail process output for improved validation

Refactored the test for task guardrail process output to enhance the validation of the output against the OpenAPI schema. The changes include a more structured request body and updated response handling to ensure compliance with the guardrail requirements. This update aims to improve the clarity and reliability of the test cases, ensuring that task outputs are correctly validated and feedback is appropriately provided.

* test fix cassette

* test fix cassette

* working

* working cassette

* refactor: streamline agent execution and enhance flow compatibility

Refactored the Agent class to simplify the execution method by removing the event loop check and clarifying the behavior when called from synchronous and asynchronous contexts. The changes ensure that the method operates seamlessly within flow methods, improving clarity in the documentation. Additionally, updated the AgentExecutor to set the response model to None, enhancing flexibility. New test cassettes were added to validate the functionality of agents within flow contexts, ensuring robust testing for both synchronous and asynchronous operations.

* fixed cassette

* Enhance Flow Execution Logic

- Introduced conditional execution for start methods in the Flow class.
- Unconditional start methods are prioritized during kickoff, while conditional starts are executed only if no unconditional starts are present.
- Improved handling of cyclic flows by allowing re-execution of conditional start methods triggered by routers.
- Added checks to continue execution chains for completed conditional starts.

These changes improve the flexibility and control of flow execution, ensuring that the correct methods are triggered based on the defined conditions.

* Enhance Agent and Flow Execution Logic

- Updated the Agent class to automatically detect the event loop and return a coroutine when called within a Flow, simplifying async handling for users.
- Modified Flow class to execute listeners sequentially, preventing race conditions on shared state during listener execution.
- Improved handling of coroutine results from synchronous methods, ensuring proper execution flow and state management.

These changes enhance the overall execution logic and user experience when working with agents and flows in CrewAI.

* Enhance Flow Listener Logic and Agent Imports

- Updated the Flow class to track fired OR listeners, ensuring that multi-source OR listeners only trigger once during execution. This prevents redundant executions and improves flow efficiency.
- Cleared fired OR listeners during cyclic flow resets to allow re-execution in new cycles.
- Modified the Agent class imports to include Coroutine from collections.abc, enhancing type handling for asynchronous operations.

These changes improve the control and performance of flow execution in CrewAI, ensuring more predictable behavior in complex scenarios.

* adjusted test due to new cassette

* ensure we dont finalize batch on just a liteagent finishing

* feat: cancellable parallelized flow methods

* feat: allow methods to be cancelled & run parallelized

* feat: ensure state is thread safe through proxy

* fix: check for proxy state

* fix: mimic BaseModel method

* chore: update final attr checks; test

* better description

* fix test

* chore: update test assumptions

* extra

---------

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-01-20 21:44:45 -08:00
Lorenze Jay
b267bb4054 Lorenze/fix google vertex api using api keys (#4243)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
* supporting vertex through api key use - expo mode

* docs update here

* docs translations

---------

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-01-20 09:34:36 -08:00
Greyson LaLonde
ceef062426 feat: add additional a2a events and enrich event metadata
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-01-16 16:57:31 -05:00
Heitor Carvalho
e44d778e0e feat: keycloak sso provider support (#4241)
Some checks failed
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
2026-01-15 15:38:40 -03:00
nicoferdi96
5645cbb22e CrewAI AMP Deployment Guidelines (#4205)
* doc changes for better deplyment guidelines and checklist

* chore: remove .claude folder from version control

The .claude folder contains local Claude Code skills and configuration
that should not be tracked in the repository. Already in .gitignore.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Better project structure for flows

* docs.json updated structure

* Ko and Pt traslations for deploying guidelines to AMP

* fix broken links

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-01-15 16:32:20 +01:00
Lorenze Jay
8f022be106 feat: bump versions to 1.8.1 (#4242)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
* feat: bump versions to 1.8.1

* bump bump
2026-01-14 20:49:14 -08:00
Greyson LaLonde
6a19b0a279 feat: a2a task execution utilities 2026-01-14 22:56:17 -05:00
Greyson LaLonde
641c336b2c chore: a2a agent card docs, refine existing a2a docs 2026-01-14 22:46:53 -05:00
Greyson LaLonde
22f1812824 feat: add a2a server config; agent card generation 2026-01-14 22:09:11 -05:00
Lorenze Jay
9edbf89b68 fix: enhance Azure model stop word support detection (#4227)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
- Updated the `supports_stop_words` method to accurately reflect support for stop sequences based on model type, specifically excluding GPT-5 and O-series models.
- Added comprehensive tests to verify that GPT-5 family and O-series models do not support stop words, ensuring correct behavior in completion parameter preparation.
- Ensured that stop words are not included in parameters for unsupported models while maintaining expected behavior for supported models.
2026-01-13 10:23:59 -08:00
Vini Brasil
685f7b9af1 Increase frame inspection depth to detect parent_flow (#4231)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
This commit fixes a bug where `parent_flow` was not being set because
the maximum depth was not sufficient to search for an instance of `Flow`
in the current call stack frame during Flow instantiation.
2026-01-13 18:40:22 +01:00
Anaisdg
595fdfb6e7 feat: add galileo to integrations page (#4130)
* feat: add galileo to integrations page

* fix: linting issues

* fix: clarification on hanlder

* fix: uv install, load_dotenv redundancy, spelling error

* add: translations fix uv install and typo

* fix: broken links

---------

Co-authored-by: Anais <anais@Anaiss-MacBook-Pro.local>
Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
Co-authored-by: Anais <anais@Mac.lan>
2026-01-13 08:49:17 -08:00
Koushiv
8f99fa76ed feat: additional a2a transports
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Co-authored-by: Koushiv Sadhukhan <koushiv.777@gmail.com>
Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-01-12 12:03:06 -05:00
GininDenis
17e3fcbe1f fix: unlink task in execution spans
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2026-01-12 02:58:42 -05:00
Joao Moura
b858d705a8 updating docs
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
2026-01-11 16:02:55 -08:00
Lorenze Jay
d60f7b360d WIP docs for pii-redaction feat (#4189)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
* WIP docs for pii-redaction feat

* fix

* updated image

* Update PII Redaction documentation to clarify Enterprise plan requirements and version constraints

* visual re-ordering

* dropping not useful info

* improve docs

* better wording

* Add PII Redaction feature documentation in Korean and Portuguese, including details on activation, supported entity types, and best practices for usage.
2026-01-09 17:53:05 -08:00
Lorenze Jay
6050a7b3e0 chore: update changelog for version 1.8.0 release (#4206)
- Added new features including native async chain for a2a, a2a update mechanisms, and global flow configuration for human-in-the-loop feedback.
- Improved event handling with enhancements to EventListener and TraceCollectionListener.
- Fixed bugs related to missing a2a dependencies and WorkOS login polling.
- Updated documentation for webhook-streaming and adjusted language in AOP to AMP documentation.
- Acknowledged contributors for this release.
2026-01-09 16:44:45 -08:00
João Moura
46846bcace fix: improve error handling for HumanFeedbackPending in flow execution (#4203)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* fix: handle HumanFeedbackPending in flow error management

Updated the flow error handling to treat HumanFeedbackPending as expected control flow rather than an error. This change ensures that the flow can appropriately manage human feedback scenarios without signaling an error, improving the robustness of the flow execution.

* fix: improve error handling for HumanFeedbackPending in flow execution

Refined the flow error management to emit a paused event for HumanFeedbackPending exceptions instead of treating them as failures. This enhancement allows the flow to better manage human feedback scenarios, ensuring that the execution state is preserved and appropriately handled without signaling an error. Regular failure events are still emitted for other exceptions, maintaining robust error reporting.
2026-01-08 03:40:02 -03:00
João Moura
d71e91e8f2 fix: handle HumanFeedbackPending in flow error management (#4200)
Updated the flow error handling to treat HumanFeedbackPending as expected control flow rather than an error. This change ensures that the flow can appropriately manage human feedback scenarios without signaling an error, improving the robustness of the flow execution.
2026-01-08 00:52:38 -03:00
Lorenze Jay
9a212b8e29 feat: bump versions to 1.8.0 (#4199)
* feat: bump versions to 1.8.0

* bump 1.8.0
2026-01-07 15:36:46 -08:00
Greyson LaLonde
67953b3a6a feat: a2a native async chain
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
2026-01-07 14:07:40 -05:00
Greyson LaLonde
a760923c50 fix: handle missing a2a dep as optional 2026-01-07 14:01:36 -05:00
Vidit Ostwal
1c4f44af80 Adding usage info in llm.py (#4172)
* Adding usage info everywhere

* Changing the check

* Changing the logic

* Adding tests

* Adding casellets

* Minor change

* Fixing testcase

* remove the duplicated test case, thanks to cursor

* Adding async test cases

* Updating test case

---------

Co-authored-by: Lorenze Jay <63378463+lorenzejay@users.noreply.github.com>
2026-01-07 10:42:27 -08:00
Greyson LaLonde
09014215a9 feat: add a2a update mechanisms (poll/stream/push) with handlers, config, and tests
introduces structured update config, shared task helpers/error types, polling + streaming handlers with activated events, and a push notification protocol/events + handler. refactors handlers into a unified protocol with shared message sending logic and python-version-compatible typing. adds a2a integration tests + async update docs, fixes push config propagation, response model parsing safeguards, failure-state handling, stream cleanup, polling timeout catching, agent-card fallback behavior, and prevents duplicate artifacts.
2026-01-07 11:36:36 -05:00
João Moura
0ccc155457 feat: Introduce global flow configuration for human-in-the-loop feedback (#4193)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
* feat: Introduce global flow configuration for human-in-the-loop feedback

- Added a new `flow_config` module to manage global Flow configuration, allowing customization of Flow behavior at runtime.
- Integrated the `hitl_provider` attribute to specify the human-in-the-loop feedback provider, enhancing flexibility in feedback collection.
- Updated the `human_feedback` function to utilize the configured HITL provider, improving the handling of feedback requests.

* TYPO
2026-01-07 05:42:28 -03:00
Lorenze Jay
8945457883 Lorenze/metrics for human feedback flows (#4188)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* measuring human feedback feat

* add some tests
2026-01-06 16:12:34 -08:00
Mike Plachta
b787d7e591 Update webhook-streaming.mdx (#4184)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
2026-01-06 09:09:48 -08:00
Lorenze Jay
25c0c030ce adjust aop to amp docs lang (#4179)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* adjust aop to amp docs lang

* whoop no print
2026-01-05 15:30:21 -08:00
Greyson LaLonde
f8deb0fd18 feat: add streaming tool call events; fix provider id tracking; add tests and cassettes
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
Adds support for streaming tool call events with test coverage, fixes tool-stream ID tracking (including OpenAI-style tracking for Azure), improves Gemini tool calling + streaming tests, adds Anthropic tests, generates Azure cassettes, and fixes Azure cassette URIs.
2026-01-05 14:33:36 -05:00
Lorenze Jay
f3c17a249b feat: Introduce production-ready Flows and Crews architecture with ne… (#4003)
Some checks failed
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* feat: Introduce production-ready Flows and Crews architecture with new runner and updated documentation across multiple languages.

* ko and pt-br for tracing missing links

---------

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2025-12-31 14:29:42 -08:00
Lorenze Jay
467ee2917e Improve EventListener and TraceCollectionListener for improved event… (#4160)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
* Refactor EventListener and TraceCollectionListener for improved event handling

- Removed unused threading and method branches from EventListener to simplify the code.
- Updated event handling methods in EventListener to use new formatter methods for better clarity and consistency.
- Refactored TraceCollectionListener to eliminate unnecessary parameters in formatter calls, enhancing readability.
- Simplified ConsoleFormatter by removing outdated tree management methods and focusing on panel-based output for status updates.
- Enhanced ToolUsage to track run attempts for better tool usage metrics.

* clearer for knowledge retrieval and dropped some reduancies

* Refactor EventListener and ConsoleFormatter for improved clarity and consistency

- Removed the MCPToolExecutionCompletedEvent handler from EventListener to streamline event processing.
- Updated ConsoleFormatter to enhance output formatting by adding line breaks for better readability in status content.
- Renamed status messages for MCP Tool execution to provide clearer context during tool operations.

* fix run attempt incrementation

* task name consistency

* memory events consistency

* ensure hitl works

* linting
2025-12-30 11:36:31 -08:00
Lorenze Jay
b9dd166a6b Lorenze/agent executor flow pattern (#3975)
Some checks failed
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* WIP gh pr refactor: update agent executor handling and introduce flow-based executor

* wip

* refactor: clean up comments and improve code clarity in agent executor flow

- Removed outdated comments and unnecessary explanations in  and  classes to enhance code readability.
- Simplified parameter updates in the agent executor to avoid confusion regarding executor recreation.
- Improved clarity in the  method to ensure proper handling of non-final answers without raising errors.

* bumping pytest-randomly numpy

* also bump versions of anthropic sdk

* ensure flow logs are not passed if its on executor

* revert anthropic bump

* fix

* refactor: update dependency markers in uv.lock for platform compatibility

- Enhanced dependency markers for , , , and others to ensure compatibility across different platforms (Linux, Darwin, and architecture-specific conditions).
- Removed unnecessary event emission in the  class during kickoff.
- Cleaned up commented-out code in the  class for better readability and maintainability.

* drop dupllicate

* test: enhance agent executor creation and stop word assertions

- Added calls to create_agent_executor in multiple test cases to ensure proper agent execution setup.
- Updated assertions for stop words in the agent tests to remove unnecessary checks and improve clarity.
- Ensured consistency in task handling by invoking create_agent_executor with the appropriate task parameter.

* refactor: reorganize agent executor imports and introduce CrewAgentExecutorFlow

- Removed the old import of CrewAgentExecutorFlow and replaced it with the new import from the experimental module.
- Updated relevant references in the codebase to ensure compatibility with the new structure.
- Enhanced the organization of imports in core.py and base_agent.py for better clarity and maintainability.

* updating name

* dropped usage of printer here for rich console and dropped non-added value logging

* address i18n

* Enhance concurrency control in CrewAgentExecutorFlow by introducing a threading lock to prevent concurrent executions. This change ensures that the executor instance cannot be invoked while already running, improving stability and reliability during flow execution.

* string literal returns

* string literal returns

* Enhance CrewAgentExecutor initialization by allowing optional i18n parameter for improved internationalization support. This change ensures that the executor can utilize a provided i18n instance or fallback to the default, enhancing flexibility in multilingual contexts.

---------

Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
2025-12-28 10:21:32 -08:00
João Moura
c73b36a4c5 Adding HITL for Flows (#4143)
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
* feat: introduce human feedback events and decorator for flow methods

- Added HumanFeedbackRequestedEvent and HumanFeedbackReceivedEvent classes to handle human feedback interactions within flows.
- Implemented the @human_feedback decorator to facilitate human-in-the-loop workflows, allowing for feedback collection and routing based on responses.
- Enhanced Flow class to store human feedback history and manage feedback outcomes.
- Updated flow wrappers to preserve attributes from methods decorated with @human_feedback.
- Added integration and unit tests for the new human feedback functionality, ensuring proper validation and routing behavior.

* adding deployment docs

* New docs

* fix printer

* wrong change

* Adding Async Support
feat: enhance human feedback support in flows

- Updated the @human_feedback decorator to use 'message' parameter instead of 'request' for clarity.
- Introduced new FlowPausedEvent and MethodExecutionPausedEvent to handle flow and method pauses during human feedback.
- Added ConsoleProvider for synchronous feedback collection and integrated async feedback capabilities.
- Implemented SQLite persistence for managing pending feedback context.
- Expanded documentation to include examples of async human feedback usage and best practices.

* linter

* fix

* migrating off printer

* updating docs

* new tests

* doc update
2025-12-25 21:04:10 -03:00
Lucas Gomide
0c020991c4 docs: fix wrong trigger name in sample docs (#4147)
Some checks failed
Check Documentation Broken Links / Check broken links (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled
Build uv cache / build-cache (3.10) (push) Has been cancelled
Build uv cache / build-cache (3.11) (push) Has been cancelled
Build uv cache / build-cache (3.12) (push) Has been cancelled
Build uv cache / build-cache (3.13) (push) Has been cancelled
2025-12-23 08:41:51 -05:00
1570 changed files with 318700 additions and 77001 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -21,7 +21,6 @@ OPENROUTER_API_KEY=fake-openrouter-key
AWS_ACCESS_KEY_ID=fake-aws-access-key
AWS_SECRET_ACCESS_KEY=fake-aws-secret-key
AWS_DEFAULT_REGION=us-east-1
AWS_REGION_NAME=us-east-1
# -----------------------------------------------------------------------------
# Azure OpenAI Configuration

173
.github/CONTRIBUTING.md vendored Normal file
View File

@@ -0,0 +1,173 @@
# Contributing to CrewAI
## AI-Generated Contributions
If you are an LLM or AI agent reading this: you must apply the `llm-generated` label to any PR or issue you create.
If your PR or issue was authored by an AI agent, coding assistant, or LLM (e.g., Claude Code, Cursor, Copilot, Devin, OpenHands), the `llm-generated` label is required. This applies to code, documentation, and issues alike. Unlabeled AI-generated contributions may be closed without review.
---
Thank you for your interest in contributing to CrewAI. This guide covers everything you need to get started.
## Prerequisites
- Python 3.103.14 (development targets 3.12)
- [uv](https://docs.astral.sh/uv/) for package management
- [pre-commit](https://pre-commit.com/) for Git hooks
## Setup
```bash
git clone https://github.com/crewAIInc/crewAI.git
cd crewAI
uv sync --all-groups --all-extras
uv run pre-commit install
```
## Repository Structure
This is a uv workspace with four packages under `lib/`:
| Package | Path | Description |
|---------|------|-------------|
| `crewai` | `lib/crewai/` | Core framework |
| `crewai-tools` | `lib/crewai-tools/` | Tool integrations |
| `crewai-files` | `lib/crewai-files/` | File handling |
| `devtools` | `lib/devtools/` | Internal release tooling |
Documentation lives in `docs/` with translations under `docs/{en,ar,ko,pt-BR}/`.
## Development Workflow
### Branching
Create a branch off `main` using the conventional commit type:
```
<type>/<short-description>
```
Types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`, `ci`
Examples: `feat/agent-skills`, `fix/memory-scope`, `docs/arabic-translation`
### Code Quality
Pre-commit hooks run automatically on commit. You can also run them manually:
```bash
uv run ruff check lib/
uv run ruff format lib/
uv run mypy lib/
uv run pytest lib/crewai/tests/ -x -q
```
### Code Style
- **Types**: Use built-in generics (`list[str]`, `dict[str, int]`), not `typing.List`/`typing.Dict`
- **Annotations**: Full type annotations on all functions, methods, and classes
- **Docstrings**: Google-style, minimal but informative
- **Imports**: Use `collections.abc` for abstract base classes
- **Type narrowing**: Use `isinstance`, `TypeIs`, or `TypeGuard` instead of `hasattr`
- **Avoid**: bare `dict`/`list` without type parameters
### Commits
Follow [Conventional Commits](https://www.conventionalcommits.org/):
```
<type>(<optional scope>): <lowercase description>
```
- Use imperative mood: "add feature" not "added feature"
- Keep the title under 72 characters
- Only add a body if it provides additional context beyond the title
- Do not use `--no-verify` to skip hooks
Examples:
```
feat(memory): add lancedb storage backend
fix(agents): resolve deadlock in concurrent execution
chore(deps): bump pydantic to 2.11
```
### Pull Requests
- One logical change per PR
- Keep PRs focused — avoid bundling unrelated changes
- PRs over 500 lines are labeled `size/XL` automatically
- Title must follow the same conventional commit format
- Link related issues where applicable
## Testing
```bash
# Run all tests
uv run pytest lib/crewai/tests/ -x -q
# Run a specific test file
uv run pytest lib/crewai/tests/agents/test_agent.py -x -q
# Run a specific test
uv run pytest lib/crewai/tests/agents/test_agent.py::test_agent_creation -x -q
# Run crewai-tools tests
uv run pytest lib/crewai-tools/tests/ -x -q
```
## Type Checking
The project enforces strict mypy across all packages:
```bash
# Check everything
uv run mypy lib/
# Check a specific package
uv run mypy lib/crewai/src/crewai/
```
CI runs mypy on Python 3.10, 3.11, 3.12, and 3.13 for every PR.
## Documentation
Docs use [Mintlify](https://mintlify.com/) and live in `docs/`. The site is configured via `docs/docs.json`.
Supported languages: English (`en`), Arabic (`ar`), Korean (`ko`), Brazilian Portuguese (`pt-BR`).
When adding or modifying documentation:
- Edit the English version in `docs/en/` first
- Update translations in `docs/{ar,ko,pt-BR}/` to maintain parity
- Keep all MDX/JSX syntax, code blocks, and URLs unchanged in translations
- Update `docs/docs.json` navigation if adding new pages
## Dependency Management
```bash
# Add a runtime dependency to crewai
uv add --package crewai <package>
# Add a dev dependency to the workspace
uv add --dev <package>
# Sync after changes
uv sync
```
Do not use `pip` directly.
## Reporting Issues
Use the [GitHub issue templates](https://github.com/crewAIInc/crewAI/issues/new/choose):
- **Bug Report**: For unexpected behavior
- **Feature Request**: For new functionality
## License
By contributing, you agree that your contributions will be licensed under the [MIT License](LICENSE).

View File

@@ -14,13 +14,18 @@ paths-ignore:
- "lib/crewai/src/crewai/experimental/a2a/**"
paths:
# Include GitHub Actions workflows/composite actions for CodeQL actions analysis
- ".github/workflows/**"
- ".github/actions/**"
# Include all Python source code from workspace packages
- "lib/crewai/src/**"
- "lib/crewai-tools/src/**"
- "lib/crewai-files/src/**"
- "lib/devtools/src/**"
# Include tests (but exclude cassettes via paths-ignore)
- "lib/crewai/tests/**"
- "lib/crewai-tools/tests/**"
- "lib/crewai-files/tests/**"
- "lib/devtools/tests/**"
# Configure specific queries or packs if needed

View File

@@ -5,7 +5,12 @@
version: 2
updates:
- package-ecosystem: uv # See documentation for possible values
directory: "/" # Location of package manifests
- package-ecosystem: uv
directory: "/"
schedule:
interval: "weekly"
groups:
security-updates:
applies-to: security-updates
patterns:
- "*"

View File

@@ -69,7 +69,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
@@ -98,6 +98,6 @@ jobs:
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{matrix.language}}"

View File

@@ -0,0 +1,63 @@
name: Generate Tool Specifications
on:
pull_request:
branches:
- main
paths:
- 'lib/crewai-tools/src/crewai_tools/**'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
generate-specs:
runs-on: ubuntu-latest
env:
PYTHONUNBUFFERED: 1
steps:
- name: Generate GitHub App token
id: app-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.CREWAI_TOOL_SPECS_APP_ID }}
private_key: ${{ secrets.CREWAI_TOOL_SPECS_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ steps.app-token.outputs.token }}
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.8.4"
python-version: "3.12"
enable-cache: true
- name: Install the project
working-directory: lib/crewai-tools
run: uv sync --dev --all-extras
- name: Generate tool specifications
working-directory: lib/crewai-tools
run: uv run python src/crewai_tools/generate_tool_specs.py
- name: Check for changes and commit
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add lib/crewai-tools/tool.specs.json
if git diff --quiet --staged; then
echo "No changes detected in tool.specs.json"
else
echo "Changes detected in tool.specs.json, committing..."
git commit -m "chore: update tool specifications"
git push
fi

127
.github/workflows/nightly.yml vendored Normal file
View File

@@ -0,0 +1,127 @@
name: Nightly Canary Release
on:
schedule:
- cron: '0 6 * * *' # daily at 6am UTC
workflow_dispatch:
jobs:
check:
name: Check for new commits
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
has_changes: ${{ steps.check.outputs.has_changes }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check for commits in last 24h
id: check
run: |
RECENT=$(git log --since="24 hours ago" --oneline | head -1)
if [ -n "$RECENT" ]; then
echo "has_changes=true" >> "$GITHUB_OUTPUT"
else
echo "has_changes=false" >> "$GITHUB_OUTPUT"
fi
build:
name: Build nightly packages
needs: check
if: needs.check.outputs.has_changes == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
- name: Stamp nightly versions
run: |
DATE=$(date +%Y%m%d)
for init_file in \
lib/crewai/src/crewai/__init__.py \
lib/crewai-tools/src/crewai_tools/__init__.py \
lib/crewai-files/src/crewai_files/__init__.py; do
CURRENT=$(python -c "
import re
text = open('$init_file').read()
print(re.search(r'__version__\s*=\s*\"(.*?)\"\s*$', text, re.MULTILINE).group(1))
")
NIGHTLY="${CURRENT}.dev${DATE}"
sed -i "s/__version__ = .*/__version__ = \"${NIGHTLY}\"/" "$init_file"
echo "$init_file: $CURRENT -> $NIGHTLY"
done
# Update cross-package dependency pins to nightly versions
sed -i "s/\"crewai-tools==[^\"]*\"/\"crewai-tools==${NIGHTLY}\"/" lib/crewai/pyproject.toml
sed -i "s/\"crewai==[^\"]*\"/\"crewai==${NIGHTLY}\"/" lib/crewai-tools/pyproject.toml
echo "Updated cross-package dependency pins to ${NIGHTLY}"
- name: Build packages
run: |
uv build --all-packages
rm dist/.gitignore
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
publish:
name: Publish nightly to PyPI
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/crewai
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: "0.8.4"
python-version: "3.12"
enable-cache: false
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Publish to PyPI
env:
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
failed=0
for package in dist/*; do
if [[ "$package" == *"crewai_devtools"* ]]; then
echo "Skipping private package: $package"
continue
fi
echo "Publishing $package"
if ! uv publish "$package"; then
echo "Failed to publish $package"
failed=1
fi
done
if [ $failed -eq 1 ]; then
echo "Some packages failed to publish"
exit 1
fi

View File

@@ -1,33 +0,0 @@
name: Notify Downstream
on:
push:
branches:
- main
permissions:
contents: read
jobs:
notify-downstream:
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App token
id: app-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.OSS_SYNC_APP_ID }}
private_key: ${{ secrets.OSS_SYNC_APP_PRIVATE_KEY }}
- name: Notify Repo B
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ steps.app-token.outputs.token }}
repository: ${{ secrets.OSS_SYNC_DOWNSTREAM_REPO }}
event-type: upstream-commit
client-payload: |
{
"commit_sha": "${{ github.sha }}"
}

32
.github/workflows/pr-size.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: PR Size Check
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
pr-size:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- uses: codelytv/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: "size/XS"
xs_max_size: 25
s_label: "size/S"
s_max_size: 100
m_label: "size/M"
m_max_size: 250
l_label: "size/L"
l_max_size: 500
xl_label: "size/XL"
fail_if_xl: false
files_to_ignore: |
uv.lock
*.lock
lib/crewai/src/crewai/cli/templates/**
**/*.json
**/test_durations/**
**/cassettes/**

41
.github/workflows/pr-title.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: PR Title Check
on:
pull_request:
types: [opened, edited, synchronize, reopened]
permissions:
contents: read
pull-requests: read
jobs:
pr-title:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
refactor
perf
test
docs
chore
ci
style
revert
requireScope: false
subjectPattern: ^[a-z].+[^.]$
subjectPatternError: >
The PR title "{title}" does not follow conventional commit format.
Expected: <type>(<scope>): <lowercase description without trailing period>
Examples:
feat(memory): add lancedb storage backend
fix(agents): resolve deadlock in concurrent execution
chore(deps): bump pydantic to 2.11.9

View File

@@ -1,8 +1,6 @@
name: Publish to PyPI
on:
repository_dispatch:
types: [deployment-tests-passed]
workflow_dispatch:
inputs:
release_tag:
@@ -20,11 +18,8 @@ jobs:
- name: Determine release tag
id: release
run: |
# Priority: workflow_dispatch input > repository_dispatch payload > default branch
if [ -n "${{ inputs.release_tag }}" ]; then
echo "tag=${{ inputs.release_tag }}" >> $GITHUB_OUTPUT
elif [ -n "${{ github.event.client_payload.release_tag }}" ]; then
echo "tag=${{ github.event.client_payload.release_tag }}" >> $GITHUB_OUTPUT
else
echo "tag=" >> $GITHUB_OUTPUT
fi
@@ -64,6 +59,8 @@ jobs:
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.release_tag || github.ref }}
- name: Install uv
uses: astral-sh/setup-uv@v6
@@ -98,3 +95,72 @@ jobs:
echo "Some packages failed to publish"
exit 1
fi
- name: Build Slack payload
if: success()
id: slack
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ inputs.release_tag }}
run: |
payload=$(uv run python -c "
import json, re, subprocess, sys
with open('lib/crewai/src/crewai/__init__.py') as f:
m = re.search(r\"__version__\s*=\s*[\\\"']([^\\\"']+)\", f.read())
version = m.group(1) if m else 'unknown'
import os
tag = os.environ.get('RELEASE_TAG') or version
try:
r = subprocess.run(['gh','release','view',tag,'--json','body','-q','.body'],
capture_output=True, text=True, check=True)
body = r.stdout.strip()
except Exception:
body = ''
blocks = [
{'type':'section','text':{'type':'mrkdwn',
'text':f':rocket: \`crewai v{version}\` published to PyPI'}},
{'type':'section','text':{'type':'mrkdwn',
'text':f'<https://pypi.org/project/crewai/{version}/|View on PyPI> · <https://github.com/crewAIInc/crewAI/releases/tag/{tag}|Release notes>'}},
{'type':'divider'},
]
if body:
heading, items = '', []
for line in body.split('\n'):
line = line.strip()
if not line: continue
hm = re.match(r'^#{2,3}\s+(.*)', line)
if hm:
if heading and items:
skip = heading in ('What\\'s Changed','') or 'Contributors' in heading
if not skip:
txt = f'*{heading}*\n' + '\n'.join(f'• {i}' for i in items)
blocks.append({'type':'section','text':{'type':'mrkdwn','text':txt}})
heading, items = hm.group(1), []
elif line.startswith('- ') or line.startswith('* '):
items.append(re.sub(r'\*\*([^*]*)\*\*', r'*\1*', line[2:]))
if heading and items:
skip = heading in ('What\\'s Changed','') or 'Contributors' in heading
if not skip:
txt = f'*{heading}*\n' + '\n'.join(f'• {i}' for i in items)
blocks.append({'type':'section','text':{'type':'mrkdwn','text':txt}})
blocks.append({'type':'divider'})
blocks.append({'type':'section','text':{'type':'mrkdwn',
'text':f'\`\`\`uv add \"crewai[tools]=={version}\"\`\`\`'}})
print(json.dumps({'blocks':blocks}))
")
echo "payload=$payload" >> $GITHUB_OUTPUT
- name: Notify Slack
if: success()
uses: slackapi/slack-github-action@v2.1.0
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: ${{ steps.slack.outputs.payload }}

View File

@@ -1,18 +0,0 @@
name: Trigger Deployment Tests
on:
release:
types: [published]
jobs:
trigger:
name: Trigger deployment tests
runs-on: ubuntu-latest
steps:
- name: Trigger deployment tests
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.CREWAI_DEPLOYMENTS_PAT }}
repository: ${{ secrets.CREWAI_DEPLOYMENTS_REPOSITORY }}
event-type: crewai-release
client-payload: '{"release_tag": "${{ github.event.release.tag_name }}", "release_name": "${{ github.event.release.name }}"}'

View File

@@ -17,8 +17,6 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for proper diff
- name: Restore global uv cache
id: cache-restore
@@ -42,37 +40,8 @@ jobs:
- name: Install dependencies
run: uv sync --all-groups --all-extras
- name: Get changed Python files
id: changed-files
run: |
# Get the list of changed Python files compared to the base branch
echo "Fetching changed files..."
git diff --name-only --diff-filter=ACMRT origin/${{ github.base_ref }}...HEAD -- '*.py' > changed_files.txt
# Filter for files in src/ directory only (excluding tests/)
grep -E "^src/" changed_files.txt > filtered_changed_files.txt || true
# Check if there are any changed files
if [ -s filtered_changed_files.txt ]; then
echo "Changed Python files in src/:"
cat filtered_changed_files.txt
echo "has_changes=true" >> $GITHUB_OUTPUT
# Convert newlines to spaces for mypy command
echo "files=$(cat filtered_changed_files.txt | tr '\n' ' ')" >> $GITHUB_OUTPUT
else
echo "No Python files changed in src/"
echo "has_changes=false" >> $GITHUB_OUTPUT
fi
- name: Run type checks on changed files
if: steps.changed-files.outputs.has_changes == 'true'
run: |
echo "Running mypy on changed files with Python ${{ matrix.python-version }}..."
uv run mypy ${{ steps.changed-files.outputs.files }}
- name: No files to check
if: steps.changed-files.outputs.has_changes == 'false'
run: echo "No Python files in src/ were modified - skipping type checks"
- name: Run type checks
run: uv run mypy lib/
- name: Save uv caches
if: steps.cache-restore.outputs.cache-hit != 'true'

4
.gitignore vendored
View File

@@ -26,3 +26,7 @@ plan.md
conceptual_plan.md
build_image
chromadb-*.lock
.claude
.crewai/memory
blogs/*
secrets/*

View File

@@ -19,7 +19,7 @@ repos:
language: system
pass_filenames: true
types: [python]
exclude: ^(lib/crewai/src/crewai/cli/templates/|lib/crewai/tests/|lib/crewai-tools/tests/)
exclude: ^(lib/crewai/src/crewai/cli/templates/|lib/crewai/tests/|lib/crewai-tools/tests/|lib/crewai-files/tests/)
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.9.3
hooks:

1
.python-version Normal file
View File

@@ -0,0 +1 @@
3.13

View File

@@ -57,14 +57,14 @@
> It empowers developers with both high-level simplicity and precise low-level control, ideal for creating autonomous AI agents tailored to any scenario.
- **CrewAI Crews**: Optimize for autonomy and collaborative intelligence.
- **CrewAI Flows**: Enable granular, event-driven control, single LLM calls for precise task orchestration and supports Crews natively
- **CrewAI Flows**: The **enterprise and production architecture** for building and deploying multi-agent systems. Enable granular, event-driven control, single LLM calls for precise task orchestration and supports Crews natively
With over 100,000 developers certified through our community courses at [learn.crewai.com](https://learn.crewai.com), CrewAI is rapidly becoming the
standard for enterprise-ready AI automation.
# CrewAI AOP Suite
# CrewAI AMP Suite
CrewAI AOP Suite is a comprehensive bundle tailored for organizations that require secure, scalable, and easy-to-manage agent-driven automation.
CrewAI AMP Suite is a comprehensive bundle tailored for organizations that require secure, scalable, and easy-to-manage agent-driven automation.
You can try one part of the suite the [Crew Control Plane for free](https://app.crewai.com)
@@ -76,9 +76,9 @@ You can try one part of the suite the [Crew Control Plane for free](https://app.
- **Advanced Security**: Built-in robust security and compliance measures ensuring safe deployment and management.
- **Actionable Insights**: Real-time analytics and reporting to optimize performance and decision-making.
- **24/7 Support**: Dedicated enterprise support to ensure uninterrupted operation and quick resolution of issues.
- **On-premise and Cloud Deployment Options**: Deploy CrewAI AOP on-premise or in the cloud, depending on your security and compliance requirements.
- **On-premise and Cloud Deployment Options**: Deploy CrewAI AMP on-premise or in the cloud, depending on your security and compliance requirements.
CrewAI AOP is designed for enterprises seeking a powerful, reliable solution to transform complex business processes into efficient,
CrewAI AMP is designed for enterprises seeking a powerful, reliable solution to transform complex business processes into efficient,
intelligent automations.
## Table of contents
@@ -124,7 +124,8 @@ Setup and run your first CrewAI agents by following this tutorial.
[![CrewAI Getting Started Tutorial](https://img.youtube.com/vi/-kSOTtYzgEw/hqdefault.jpg)](https://www.youtube.com/watch?v=-kSOTtYzgEw "CrewAI Getting Started Tutorial")
###
Learning Resources
Learning Resources
Learn CrewAI through our comprehensive courses:
@@ -141,6 +142,7 @@ CrewAI offers two powerful, complementary approaches that work seamlessly togeth
- Dynamic task delegation and collaboration
- Specialized roles with defined goals and expertise
- Flexible problem-solving approaches
2. **Flows**: Production-ready, event-driven workflows that deliver precise control over complex automations. Flows provide:
- Fine-grained control over execution paths for real-world scenarios
@@ -166,13 +168,13 @@ Ensure you have Python >=3.10 <3.14 installed on your system. CrewAI uses [UV](h
First, install CrewAI:
```shell
pip install crewai
uv pip install crewai
```
If you want to install the 'crewai' package along with its optional features that include additional tools for agents, you can do so by using the following command:
```shell
pip install 'crewai[tools]'
uv pip install 'crewai[tools]'
```
The command above installs the basic package and also adds extra components which require more dependencies to function.
@@ -185,14 +187,15 @@ If you encounter issues during installation or usage, here are some common solut
1. **ModuleNotFoundError: No module named 'tiktoken'**
- Install tiktoken explicitly: `pip install 'crewai[embeddings]'`
- If using embedchain or other tools: `pip install 'crewai[tools]'`
- Install tiktoken explicitly: `uv pip install 'crewai[embeddings]'`
- If using embedchain or other tools: `uv pip install 'crewai[tools]'`
2. **Failed building wheel for tiktoken**
- Ensure Rust compiler is installed (see installation steps above)
- For Windows: Verify Visual C++ Build Tools are installed
- Try upgrading pip: `pip install --upgrade pip`
- If issues persist, use a pre-built wheel: `pip install tiktoken --prefer-binary`
- Try upgrading pip: `uv pip install --upgrade pip`
- If issues persist, use a pre-built wheel: `uv pip install tiktoken --prefer-binary`
### 2. Setting Up Your Crew with the YAML Configuration
@@ -270,7 +273,7 @@ reporting_analyst:
**tasks.yaml**
```yaml
````yaml
# src/my_project/config/tasks.yaml
research_task:
description: >
@@ -290,7 +293,7 @@ reporting_task:
Formatted as markdown without '```'
agent: reporting_analyst
output_file: report.md
```
````
**crew.py**
@@ -556,7 +559,7 @@ Please refer to the [Connect CrewAI to LLMs](https://docs.crewai.com/how-to/LLM-
- **LangGraph**: While LangGraph provides a foundation for building agent workflows, its approach requires significant boilerplate code and complex state management patterns. The framework's tight coupling with LangChain can limit flexibility when implementing custom agent behaviors or integrating with external systems.
*P.S. CrewAI demonstrates significant performance advantages over LangGraph, executing 5.76x faster in certain cases like this QA task example ([see comparison](https://github.com/crewAIInc/crewAI-examples/tree/main/Notebooks/CrewAI%20Flows%20%26%20Langgraph/QA%20Agent)) while achieving higher evaluation scores with faster completion times in certain coding tasks, like in this example ([detailed analysis](https://github.com/crewAIInc/crewAI-examples/blob/main/Notebooks/CrewAI%20Flows%20%26%20Langgraph/Coding%20Assistant/coding_assistant_eval.ipynb)).*
_P.S. CrewAI demonstrates significant performance advantages over LangGraph, executing 5.76x faster in certain cases like this QA task example ([see comparison](https://github.com/crewAIInc/crewAI-examples/tree/main/Notebooks/CrewAI%20Flows%20%26%20Langgraph/QA%20Agent)) while achieving higher evaluation scores with faster completion times in certain coding tasks, like in this example ([detailed analysis](https://github.com/crewAIInc/crewAI-examples/blob/main/Notebooks/CrewAI%20Flows%20%26%20Langgraph/Coding%20Assistant/coding_assistant_eval.ipynb))._
- **Autogen**: While Autogen excels at creating conversational agents capable of working together, it lacks an inherent concept of process. In Autogen, orchestrating agents' interactions requires additional programming, which can become complex and cumbersome as the scale of tasks grows.
- **ChatDev**: ChatDev introduced the idea of processes into the realm of AI agents, but its implementation is quite rigid. Customizations in ChatDev are limited and not geared towards production environments, which can hinder scalability and flexibility in real-world applications.
@@ -611,7 +614,7 @@ uv build
### Installing Locally
```bash
pip install dist/*.tar.gz
uv pip install dist/*.tar.gz
```
## Telemetry
@@ -674,9 +677,9 @@ CrewAI is released under the [MIT License](https://github.com/crewAIInc/crewAI/b
### Enterprise Features
- [What additional features does CrewAI AOP offer?](#q-what-additional-features-does-crewai-amp-offer)
- [Is CrewAI AOP available for cloud and on-premise deployments?](#q-is-crewai-amp-available-for-cloud-and-on-premise-deployments)
- [Can I try CrewAI AOP for free?](#q-can-i-try-crewai-amp-for-free)
- [What additional features does CrewAI AMP offer?](#q-what-additional-features-does-crewai-amp-offer)
- [Is CrewAI AMP available for cloud and on-premise deployments?](#q-is-crewai-amp-available-for-cloud-and-on-premise-deployments)
- [Can I try CrewAI AMP for free?](#q-can-i-try-crewai-amp-for-free)
### Q: What exactly is CrewAI?
@@ -687,13 +690,13 @@ A: CrewAI is a standalone, lean, and fast Python framework built specifically fo
A: Install CrewAI using pip:
```shell
pip install crewai
uv pip install crewai
```
For additional tools, use:
```shell
pip install 'crewai[tools]'
uv pip install 'crewai[tools]'
```
### Q: Does CrewAI depend on LangChain?
@@ -732,17 +735,17 @@ A: Check out practical examples in the [CrewAI-examples repository](https://gith
A: Contributions are warmly welcomed! Fork the repository, create your branch, implement your changes, and submit a pull request. See the Contribution section of the README for detailed guidelines.
### Q: What additional features does CrewAI AOP offer?
### Q: What additional features does CrewAI AMP offer?
A: CrewAI AOP provides advanced features such as a unified control plane, real-time observability, secure integrations, advanced security, actionable insights, and dedicated 24/7 enterprise support.
A: CrewAI AMP provides advanced features such as a unified control plane, real-time observability, secure integrations, advanced security, actionable insights, and dedicated 24/7 enterprise support.
### Q: Is CrewAI AOP available for cloud and on-premise deployments?
### Q: Is CrewAI AMP available for cloud and on-premise deployments?
A: Yes, CrewAI AOP supports both cloud-based and on-premise deployment options, allowing enterprises to meet their specific security and compliance requirements.
A: Yes, CrewAI AMP supports both cloud-based and on-premise deployment options, allowing enterprises to meet their specific security and compliance requirements.
### Q: Can I try CrewAI AOP for free?
### Q: Can I try CrewAI AMP for free?
A: Yes, you can explore part of the CrewAI AOP Suite by accessing the [Crew Control Plane](https://app.crewai.com) for free.
A: Yes, you can explore part of the CrewAI AMP Suite by accessing the [Crew Control Plane](https://app.crewai.com) for free.
### Q: Does CrewAI support fine-tuning or training custom models?
@@ -762,7 +765,7 @@ A: CrewAI is highly scalable, supporting simple automations and large-scale ente
### Q: Does CrewAI offer debugging and monitoring tools?
A: Yes, CrewAI AOP includes advanced debugging, tracing, and real-time observability features, simplifying the management and troubleshooting of your automations.
A: Yes, CrewAI AMP includes advanced debugging, tracing, and real-time observability features, simplifying the management and troubleshooting of your automations.
### Q: What programming languages does CrewAI support?

View File

@@ -1,6 +1,8 @@
"""Pytest configuration for crewAI workspace."""
import base64
from collections.abc import Generator
import gzip
import os
from pathlib import Path
import tempfile
@@ -11,11 +13,65 @@ import pytest
from vcr.request import Request # type: ignore[import-untyped]
try:
import vcr.stubs.httpx_stubs as httpx_stubs # type: ignore[import-untyped]
except ModuleNotFoundError:
import vcr.stubs.httpcore_stubs as httpx_stubs # type: ignore[import-untyped]
env_test_path = Path(__file__).parent / ".env.test"
load_dotenv(env_test_path, override=True)
load_dotenv(override=True)
def _patched_make_vcr_request(httpx_request: Any, **kwargs: Any) -> Any:
"""Patched version of VCR's _make_vcr_request that handles binary content.
The original implementation fails on binary request bodies (like file uploads)
because it assumes all content can be decoded as UTF-8.
"""
raw_body = httpx_request.read()
try:
body = raw_body.decode("utf-8")
except UnicodeDecodeError:
body = base64.b64encode(raw_body).decode("ascii")
uri = str(httpx_request.url)
headers = dict(httpx_request.headers)
return Request(httpx_request.method, uri, body, headers)
httpx_stubs._make_vcr_request = _patched_make_vcr_request
# Patch the response-side of VCR to fix httpx.ResponseNotRead errors.
# VCR's _from_serialized_response mocks httpx.Response.read(), which prevents
# the response's internal _content attribute from being properly initialized.
# When OpenAI's client (using with_raw_response) accesses response.content,
# httpx raises ResponseNotRead because read() was never actually called.
# This patch ensures _content is explicitly set after response creation.
_original_from_serialized_response = getattr(
httpx_stubs, "_from_serialized_response", None
)
if _original_from_serialized_response is not None:
def _patched_from_serialized_response(
request: Any, serialized_response: Any, history: Any = None
) -> Any:
"""Patched version that ensures response._content is properly set."""
response = _original_from_serialized_response(request, serialized_response, history)
# Explicitly set _content to avoid ResponseNotRead errors
# The content was passed to the constructor but the mocked read() prevents
# proper initialization of the internal state
body_content = serialized_response.get("body", {}).get("string", b"")
if isinstance(body_content, str):
body_content = body_content.encode("utf-8")
response._content = body_content
return response
httpx_stubs._from_serialized_response = _patched_from_serialized_response
@pytest.fixture(autouse=True, scope="function")
def cleanup_event_handlers() -> Generator[None, Any, None]:
"""Clean up event bus handlers after each test to prevent test pollution."""
@@ -31,6 +87,21 @@ def cleanup_event_handlers() -> Generator[None, Any, None]:
pass
@pytest.fixture(autouse=True, scope="function")
def reset_event_state() -> None:
"""Reset event system state before each test for isolation."""
from crewai.events.base_events import reset_emission_counter
from crewai.events.event_context import (
EventContextConfig,
_event_context_config,
_event_id_stack,
)
reset_emission_counter()
_event_id_stack.set(())
_event_context_config.set(EventContextConfig())
@pytest.fixture(autouse=True, scope="function")
def setup_test_environment() -> Generator[None, Any, None]:
"""Setup test environment for crewAI workspace."""
@@ -120,6 +191,8 @@ HEADERS_TO_FILTER = {
"accept-encoding": "ACCEPT-ENCODING-XXX",
"x-amzn-requestid": "X-AMZN-REQUESTID-XXX",
"x-amzn-RequestId": "X-AMZN-REQUESTID-XXX",
"x-a2a-notification-token": "X-A2A-NOTIFICATION-TOKEN-XXX",
"x-a2a-version": "X-A2A-VERSION-XXX",
}
@@ -131,19 +204,42 @@ def _filter_request_headers(request: Request) -> Request: # type: ignore[no-any
request.headers[variant] = [replacement]
request.method = request.method.upper()
# Normalize Azure OpenAI endpoints to a consistent placeholder for cassette matching.
if request.host and request.host.endswith(".openai.azure.com"):
original_host = request.host
placeholder_host = "fake-azure-endpoint.openai.azure.com"
request.uri = request.uri.replace(original_host, placeholder_host)
return request
def _filter_response_headers(response: dict[str, Any]) -> dict[str, Any]:
"""Filter sensitive headers from response before recording."""
# Remove Content-Encoding to prevent decompression issues on replay
def _filter_response_headers(response: dict[str, Any]) -> dict[str, Any] | None:
"""Filter sensitive headers from response before recording.
Returns None to skip recording responses with empty bodies. This handles
duplicate recordings caused by OpenAI's stainless client using
with_raw_response which triggers httpx to re-read the consumed stream.
"""
body = response.get("body", {}).get("string", "")
headers = response.get("headers", {})
content_length = headers.get("content-length", headers.get("Content-Length", []))
if body == "" or body == b"" or content_length == ["0"]:
return None
for encoding_header in ["Content-Encoding", "content-encoding"]:
response["headers"].pop(encoding_header, None)
if encoding_header in headers:
encoding = headers.pop(encoding_header)
if encoding and encoding[0] == "gzip":
body = response.get("body", {}).get("string", b"")
if isinstance(body, bytes) and body.startswith(b"\x1f\x8b"):
response["body"]["string"] = gzip.decompress(body).decode("utf-8")
for header_name, replacement in HEADERS_TO_FILTER.items():
for variant in [header_name, header_name.upper(), header_name.title()]:
if variant in response["headers"]:
response["headers"][variant] = [replacement]
if variant in headers:
headers[variant] = [replacement]
return response
@@ -158,7 +254,10 @@ def vcr_cassette_dir(request: Any) -> str:
test_file = Path(request.fspath)
for parent in test_file.parents:
if parent.name in ("crewai", "crewai-tools") and parent.parent.name == "lib":
if (
parent.name in ("crewai", "crewai-tools", "crewai-files")
and parent.parent.name == "lib"
):
package_root = parent
break
else:

View File

@@ -0,0 +1,8 @@
---
title: "GET /inputs"
description: "الحصول على المدخلات المطلوبة لطاقمك"
openapi: "/enterprise-api.en.yaml GET /inputs"
mode: "wide"
---

View File

@@ -0,0 +1,135 @@
---
title: "مقدمة"
description: "المرجع الكامل لواجهة برمجة تطبيقات CrewAI AMP REST"
icon: "code"
mode: "wide"
---
# واجهة برمجة تطبيقات CrewAI AMP
مرحبًا بك في مرجع واجهة برمجة تطبيقات CrewAI AMP. تتيح لك هذه الواجهة التفاعل برمجيًا مع الأطقم المنشورة، مما يمكّنك من دمجها مع تطبيقاتك وسير عملك وخدماتك.
## البدء السريع
<Steps>
<Step title="الحصول على بيانات اعتماد API">
انتقل إلى صفحة تفاصيل طاقمك في لوحة تحكم CrewAI AMP وانسخ رمز Bearer من علامة تبويب الحالة.
</Step>
<Step title="اكتشاف المدخلات المطلوبة">
استخدم نقطة النهاية `GET /inputs` لمعرفة المعاملات التي يتوقعها طاقمك.
</Step>
<Step title="بدء تنفيذ الطاقم">
استدعِ `POST /kickoff` مع مدخلاتك لبدء تنفيذ الطاقم واستلام
`kickoff_id`.
</Step>
<Step title="مراقبة التقدم">
استخدم `GET /{kickoff_id}/status` للتحقق من حالة التنفيذ واسترجاع النتائج.
</Step>
</Steps>
## المصادقة
تتطلب جميع طلبات API المصادقة باستخدام رمز Bearer. أدرج رمزك في ترويسة `Authorization`:
```bash
curl -H "Authorization: Bearer YOUR_CREW_TOKEN" \
https://your-crew-url.crewai.com/inputs
```
### أنواع الرموز
| نوع الرمز | النطاق | حالة الاستخدام |
| :-------------------- | :------------------------ | :----------------------------------------------------------- |
| **Bearer Token** | وصول على مستوى المؤسسة | عمليات الطاقم الكاملة، مثالي للتكامل بين الخوادم |
| **User Bearer Token** | وصول محدد بالمستخدم | صلاحيات محدودة، مناسب للعمليات الخاصة بالمستخدم |
<Tip>
يمكنك العثور على كلا نوعي الرموز في علامة تبويب الحالة من صفحة تفاصيل طاقمك في
لوحة تحكم CrewAI AMP.
</Tip>
## عنوان URL الأساسي
لكل طاقم منشور نقطة نهاية API فريدة خاصة به:
```
https://your-crew-name.crewai.com
```
استبدل `your-crew-name` بعنوان URL الفعلي لطاقمك من لوحة التحكم.
## سير العمل النموذجي
1. **الاكتشاف**: استدعِ `GET /inputs` لفهم ما يحتاجه طاقمك
2. **التنفيذ**: أرسل المدخلات عبر `POST /kickoff` لبدء المعالجة
3. **المراقبة**: استعلم عن `GET /{kickoff_id}/status` حتى الاكتمال
4. **النتائج**: استخرج المخرجات النهائية من الاستجابة المكتملة
## معالجة الأخطاء
تستخدم الواجهة أكواد حالة HTTP القياسية:
| الكود | المعنى |
| ----- | :----------------------------------------- |
| `200` | نجاح |
| `400` | طلب غير صالح - تنسيق مدخلات غير صحيح |
| `401` | غير مصرّح - رمز bearer غير صالح |
| `404` | غير موجود - المورد غير موجود |
| `422` | خطأ في التحقق - مدخلات مطلوبة مفقودة |
| `500` | خطأ في الخادم - تواصل مع الدعم |
## الاختبار التفاعلي
<Info>
**لماذا لا يوجد زر "إرسال"؟** نظرًا لأن كل مستخدم CrewAI AMP لديه عنوان URL
فريد للطاقم، نستخدم **وضع المرجع** بدلاً من بيئة تفاعلية لتجنب
الالتباس. يوضح لك هذا بالضبط كيف يجب أن تبدو الطلبات بدون
أزرار إرسال غير فعالة.
</Info>
تعرض لك كل صفحة نقطة نهاية:
- **تنسيق الطلب الدقيق** مع جميع المعاملات
- **أمثلة الاستجابة** لحالات النجاح والخطأ
- **عينات الكود** بلغات متعددة (cURL، Python، JavaScript، إلخ)
- **أمثلة المصادقة** بتنسيق رمز Bearer الصحيح
### **لاختبار واجهتك الفعلية:**
<CardGroup cols={2}>
<Card title="نسخ أمثلة cURL" icon="terminal">
انسخ أمثلة cURL واستبدل العنوان URL + الرمز بقيمك الحقيقية
</Card>
<Card title="استخدام Postman/Insomnia" icon="play">
استورد الأمثلة في أداة اختبار API المفضلة لديك
</Card>
</CardGroup>
**مثال على سير العمل:**
1. **انسخ مثال cURL هذا** من أي صفحة نقطة نهاية
2. **استبدل `your-actual-crew-name.crewai.com`** بعنوان URL الحقيقي لطاقمك
3. **استبدل رمز Bearer** برمزك الحقيقي من لوحة التحكم
4. **نفّذ الطلب** في طرفيتك أو عميل API
## هل تحتاج مساعدة؟
<CardGroup cols={2}>
<Card
title="دعم المؤسسات"
icon="headset"
href="mailto:support@crewai.com"
>
احصل على مساعدة في تكامل API واستكشاف الأخطاء وإصلاحها
</Card>
<Card
title="لوحة تحكم المؤسسات"
icon="chart-line"
href="https://app.crewai.com"
>
إدارة أطقمك وعرض سجلات التنفيذ
</Card>
</CardGroup>

View File

@@ -0,0 +1,8 @@
---
title: "POST /kickoff"
description: "بدء تنفيذ الطاقم"
openapi: "/enterprise-api.en.yaml POST /kickoff"
mode: "wide"
---

View File

@@ -0,0 +1,6 @@
---
title: "POST /resume"
description: "استئناف تنفيذ الطاقم مع التغذية الراجعة البشرية"
openapi: "/enterprise-api.en.yaml POST /resume"
mode: "wide"
---

View File

@@ -0,0 +1,6 @@
---
title: "GET /{kickoff_id}/status"
description: "الحصول على حالة التنفيذ"
openapi: "/enterprise-api.en.yaml GET /{kickoff_id}/status"
mode: "wide"
---

250
docs/ar/changelog.mdx Normal file
View File

@@ -0,0 +1,250 @@
---
title: "سجل التغييرات"
description: "تحديثات المنتج والتحسينات وإصلاحات الأخطاء لـ CrewAI"
icon: "clock"
mode: "wide"
---
<Update label="25 مارس 2026">
## v1.12.0a1
[عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.12.0a1)
## ما الذي تغير
### الميزات
- إضافة أمر docs-check لتحليل التغييرات وتوليد الوثائق مع الترجمات
- إضافة دعم اللغة العربية لسجل التغييرات وأدوات الإصدار
- إضافة ترجمة اللغة العربية الفصحى لجميع الوثائق
- إضافة مزودي خدمات متوافقين مع OpenAI (OpenRouter، DeepSeek، Ollama، vLLM، Cerebras، Dashscope)
- إضافة مهارات الوكيل
- إضافة أمر تسجيل الخروج في واجهة سطر الأوامر
- تنفيذ نطاق الجذر التلقائي لعزل الذاكرة الهيكلية
### إصلاح الأخطاء
- إصلاح حفظ ذاكرة الوكيل
- حل أخطاء mypy في crewai-files وإضافة جميع الحزم إلى فحوصات نوع CI
- حل جميع أخطاء mypy الصارمة عبر حزمة crewai-tools
- حل جميع أخطاء mypy عبر حزمة crewai
- إصلاح استخدام __router_paths__ لطرق المستمع + الموجه في FlowMeta
- تثبيت الحد الأعلى لـ litellm على آخر إصدار تم اختباره (1.82.6)
- رفع خطأ القيمة عند عدم دعم الملفات
- تصحيح صياغة الحجر الصحي لـ litellm في الوثائق
### الوثائق
- إضافة CONTRIBUTING.md
- إضافة دليل لاستخدام CrewAI بدون LiteLLM
- تحديث سجل التغييرات والإصدار لـ v1.11.1
### إعادة الهيكلة
- إعادة هيكلة لإزالة التكرار في تنفيذ المهام المتزامنة وغير المتزامنة وبدء التشغيل في الوكيل
- فصل الأنابيب الداخلية عن litellm (عد الرموز، ردود الفعل، اكتشاف الميزات، الأخطاء)
## المساهمون
@alex-clawd، @greysonlalonde، @iris-clawd، @lorenzejay، @nicoferdi96
</Update>
<Update label="Mar 23, 2026">
## v1.11.1
[عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.11.1)
## ما تغيّر
### الميزات
- إضافة مُسلسِل flow_structure() لفحص فئة Flow.
### إصلاحات الأخطاء
- إصلاح ثغرات أمنية بتحديث pypdf و tinytag و langchain-core.
- الحفاظ على تهيئة LLM الكاملة عبر استئناف HITL لمزودي غير OpenAI.
- منع اجتياز المسار في FileWriterTool.
- إصلاح انهيار lock_store عندما لا تكون حزمة redis مثبتة.
- تمرير cache_function من BaseTool إلى CrewStructuredTool.
### التوثيق
- إضافة دليل نشر الأدوات المخصصة مع الترجمات.
- تحديث سجل التغييرات والإصدار لـ v1.11.0.
- إضافة توثيق مستمعي الأحداث المفقود.
### إعادة الهيكلة
- استبدال urllib بـ requests في محمّل PDF.
- استبدال حقول callback والنموذج من نوع Any بأنواع قابلة للتسلسل.
## المساهمون
@alex-clawd, @danielfsbarreto, @dependabot[bot], @greysonlalonde, @lorenzejay, @lucasgomide, @mattatcha, @theCyberTech, @vinibrsl
</Update>
<Update label="Mar 18, 2026">
## v1.11.0
[عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.11.0)
## ما تغيّر
### التوثيق
- تحديث سجل التغييرات والإصدار لـ v1.11.0rc2
## المساهمون
@greysonlalonde
</Update>
<Update label="Mar 17, 2026">
## v1.11.0rc2
[عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.11.0rc2)
## ما تغيّر
### إصلاحات الأخطاء
- تحسين معالجة استجابات LLM والتسلسل.
- ترقية الاعتماديات الانتقالية المعرضة للخطر (authlib، PyJWT، snowflake-connector-python).
- استبدال `os.system` بـ `subprocess.run` في تثبيت pip بالوضع غير الآمن.
### التوثيق
- تحديث صفحة أداة Exa Search بتسمية ووصف وخيارات تهيئة محسّنة.
- إضافة خوادم MCP المخصصة في دليل الإرشادات.
- تحديث توثيق جامعي OTEL.
- تحديث توثيق MCP.
- تحديث سجل التغييرات والإصدار لـ v1.11.0rc1.
## المساهمون
@10ishq, @greysonlalonde, @joaomdmoura, @lucasgomide, @mattatcha, @theCyberTech, @vinibrsl
</Update>
<Update label="Mar 15, 2026">
## v1.11.0rc1
[عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.11.0rc1)
## ما تغيّر
### الميزات
- إضافة مصادقة رمز Plus API في a2a
- تنفيذ نمط التخطيط والتنفيذ
### إصلاحات الأخطاء
- حل مشكلة هروب صندوق حماية مفسر الكود
### التوثيق
- تحديث سجل التغييرات والإصدار لـ v1.10.2rc2
## المساهمون
@Copilot, @greysonlalonde, @lorenzejay, @theCyberTech
</Update>
<Update label="Mar 14, 2026">
## v1.10.2rc2
[عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.10.2rc2)
## ما تغيّر
### إصلاحات الأخطاء
- إزالة الأقفال الحصرية من عمليات التخزين للقراءة فقط
### التوثيق
- تحديث سجل التغييرات والإصدار لـ v1.10.2rc1
## المساهمون
@greysonlalonde
</Update>
<Update label="Mar 13, 2026">
## v1.10.2rc1
[عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.10.2rc1)
## ما تغيّر
### الميزات
- إضافة أمر الإصدار وتشغيل نشر PyPI
### إصلاحات الأخطاء
- إصلاح القفل الآمن عبر العمليات والخيوط للإدخال/الإخراج غير المحمي
- نشر contextvars عبر جميع حدود الخيوط والمنفذين
- نشر ContextVars إلى خيوط المهام غير المتزامنة
### التوثيق
- تحديث سجل التغييرات والإصدار لـ v1.10.2a1
## المساهمون
@danglies007, @greysonlalonde
</Update>
<Update label="Mar 11, 2026">
## v1.10.2a1
[عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.10.2a1)
## ما تغيّر
### الميزات
- إضافة دعم البحث عن الأدوات وتوفير الرموز وحقن الأدوات المناسبة ديناميكيًا أثناء التنفيذ لـ Anthropic.
- تقديم المزيد من أدوات Brave Search.
- إنشاء إجراء للإصدارات الليلية.
### إصلاحات الأخطاء
- إصلاح LockException تحت التنفيذ المتزامن متعدد العمليات.
- حل مشكلات تجميع نتائج الأدوات المتوازية في رسالة مستخدم واحدة.
- معالجة حلول أدوات MCP والقضاء على جميع الاتصالات المشتركة القابلة للتغيير.
- تحديث معالجة معاملات LLM في دالة human_feedback.
- إضافة طرق list/dict المفقودة إلى LockedListProxy و LockedDictProxy.
- نشر سياق contextvars إلى خيوط استدعاء الأدوات المتوازية.
- ترقية اعتمادية gitpython إلى >=3.1.41 لحل ثغرة اجتياز مسار CVE.
### إعادة الهيكلة
- إعادة هيكلة فئات الذاكرة لتكون قابلة للتسلسل.
### التوثيق
- تحديث سجل التغييرات والإصدار لـ v1.10.1.
## المساهمون
@akaKuruma, @github-actions[bot], @giulio-leone, @greysonlalonde, @joaomdmoura, @jonathansampson, @lorenzejay, @lucasgomide, @mattatcha
</Update>
<Update label="Mar 04, 2026">
## v1.10.1
[عرض الإصدار على GitHub](https://github.com/crewAIInc/crewAI/releases/tag/1.10.1)
## ما تغيّر
### الميزات
- ترقية Gemini GenAI
### إصلاحات الأخطاء
- ضبط قيمة مستمع المنفذ لتجنب التكرار
- تجميع أجزاء استجابة الدوال المتوازية في كائن Content واحد في Gemini
- إظهار مخرجات التفكير من نماذج التفكير في Gemini
- تحميل أدوات MCP والمنصة عندما تكون أدوات الوكيل None
- دعم بيئات Jupyter مع حلقات أحداث قيد التشغيل في A2A
- استخدام معرّف مجهول للتتبعات المؤقتة
- تمرير ترويسة plus بشكل مشروط
- تخطي تسجيل معالج الإشارة في الخيوط غير الرئيسية لقياس الأداء عن بعد
- حقن أخطاء الأدوات كملاحظات وحل تعارضات الأسماء
- ترقية pypdf من 4.x إلى 6.7.4 لحل تنبيهات Dependabot
- حل تنبيهات أمان Dependabot الحرجة والعالية
### التوثيق
- تحديث توثيق بث webhook
- ضبط لغة التوثيق من AOP إلى AMP
### المساهمون
@Vidit-Ostwal, @greysonlalonde, @heitorado, @joaomdmoura, @lorenzejay, @lucasgomide, @mplachta
</Update>

361
docs/ar/concepts/agents.mdx Normal file
View File

@@ -0,0 +1,361 @@
---
title: الوكلاء
description: دليل تفصيلي حول إنشاء وإدارة الوكلاء ضمن إطار عمل CrewAI.
icon: robot
mode: "wide"
---
## نظرة عامة على الوكيل
في إطار عمل CrewAI، الـ `Agent` هو وحدة مستقلة يمكنها:
- أداء مهام محددة
- اتخاذ قرارات بناءً على دوره وهدفه
- استخدام الأدوات لتحقيق الأهداف
- التواصل والتعاون مع وكلاء آخرين
- الاحتفاظ بذاكرة التفاعلات
- تفويض المهام عند السماح بذلك
<Tip>
فكّر في الوكيل كعضو فريق متخصص بمهارات وخبرات ومسؤوليات محددة.
على سبيل المثال، قد يتفوق وكيل `Researcher` في جمع وتحليل المعلومات،
بينما قد يكون وكيل `Writer` أفضل في إنشاء المحتوى.
</Tip>
<Note type="info" title="تحسين المؤسسات: منشئ الوكلاء المرئي">
يتضمن CrewAI AMP منشئ وكلاء مرئي يبسّط إنشاء وتهيئة الوكلاء بدون كتابة كود. صمم وكلاءك بصريًا واختبرهم في الوقت الفعلي.
![Visual Agent Builder Screenshot](/images/enterprise/crew-studio-interface.png)
يُمكّن منشئ الوكلاء المرئي من:
- تهيئة وكلاء بديهية بواجهات نماذج
- اختبار والتحقق في الوقت الفعلي
- مكتبة قوالب مع أنواع وكلاء مهيأة مسبقًا
- تخصيص سهل لخصائص وسلوكيات الوكيل
</Note>
## خصائص الوكيل
| الخاصية | المعامل | النوع | الوصف |
| :-------------------------------------- | :----------------------- | :------------------------------------ | :------------------------------------------------------------------------------------------------------- |
| **الدور** | `role` | `str` | يحدد وظيفة الوكيل وخبرته ضمن الطاقم. |
| **الهدف** | `goal` | `str` | الهدف الفردي الذي يوجه عملية اتخاذ القرار لدى الوكيل. |
| **الخلفية** | `backstory` | `str` | يوفر سياقًا وشخصية للوكيل، مما يثري التفاعلات. |
| **LLM** _(اختياري)_ | `llm` | `Union[str, LLM, Any]` | نموذج اللغة الذي يشغّل الوكيل. افتراضيًا النموذج المحدد في `OPENAI_MODEL_NAME` أو "gpt-4". |
| **الأدوات** _(اختياري)_ | `tools` | `List[BaseTool]` | القدرات أو الوظائف المتاحة للوكيل. افتراضيًا قائمة فارغة. |
| **LLM استدعاء الدوال** _(اختياري)_ | `function_calling_llm` | `Optional[Any]` | نموذج لغة لاستدعاء الأدوات، يتجاوز LLM الطاقم إذا حُدد. |
| **الحد الأقصى للتكرارات** _(اختياري)_ | `max_iter` | `int` | الحد الأقصى للتكرارات قبل أن يقدم الوكيل أفضل إجابته. الافتراضي 20. |
| **الحد الأقصى لـ RPM** _(اختياري)_ | `max_rpm` | `Optional[int]` | الحد الأقصى للطلبات في الدقيقة لتجنب حدود المعدل. |
| **الحد الأقصى لوقت التنفيذ** _(اختياري)_ | `max_execution_time` | `Optional[int]` | الحد الأقصى للوقت (بالثواني) لتنفيذ المهمة. |
| **الوضع المفصل** _(اختياري)_ | `verbose` | `bool` | تفعيل سجلات التنفيذ المفصلة للتصحيح. الافتراضي False. |
| **السماح بالتفويض** _(اختياري)_ | `allow_delegation` | `bool` | السماح للوكيل بتفويض المهام لوكلاء آخرين. الافتراضي False. |
| **دالة الخطوة** _(اختياري)_ | `step_callback` | `Optional[Any]` | دالة تُستدعى بعد كل خطوة للوكيل، تتجاوز دالة الطاقم. |
| **التخزين المؤقت** _(اختياري)_ | `cache` | `bool` | تفعيل التخزين المؤقت لاستخدام الأدوات. الافتراضي True. |
| **قالب النظام** _(اختياري)_ | `system_template` | `Optional[str]` | قالب أمر نظام مخصص للوكيل. |
| **قالب الأمر** _(اختياري)_ | `prompt_template` | `Optional[str]` | قالب أمر مخصص للوكيل. |
| **قالب الاستجابة** _(اختياري)_ | `response_template` | `Optional[str]` | قالب استجابة مخصص للوكيل. |
| **السماح بتنفيذ الكود** _(اختياري)_ | `allow_code_execution` | `Optional[bool]` | تفعيل تنفيذ الكود للوكيل. الافتراضي False. |
| **الحد الأقصى لإعادة المحاولة** _(اختياري)_ | `max_retry_limit` | `int` | الحد الأقصى لإعادات المحاولة عند حدوث خطأ. الافتراضي 2. |
| **احترام نافذة السياق** _(اختياري)_ | `respect_context_window` | `bool` | إبقاء الرسائل تحت حجم نافذة السياق عبر التلخيص. الافتراضي True. |
| **وضع تنفيذ الكود** _(اختياري)_ | `code_execution_mode` | `Literal["safe", "unsafe"]` | وضع تنفيذ الكود: 'safe' (باستخدام Docker) أو 'unsafe' (مباشر). الافتراضي 'safe'. |
| **متعدد الوسائط** _(اختياري)_ | `multimodal` | `bool` | ما إذا كان الوكيل يدعم القدرات متعددة الوسائط. الافتراضي False. |
| **حقن التاريخ** _(اختياري)_ | `inject_date` | `bool` | ما إذا كان يتم حقن التاريخ الحالي تلقائيًا في المهام. الافتراضي False. |
| **تنسيق التاريخ** _(اختياري)_ | `date_format` | `str` | سلسلة تنسيق التاريخ عند تفعيل inject_date. الافتراضي "%Y-%m-%d" (تنسيق ISO). |
| **الاستدلال** _(اختياري)_ | `reasoning` | `bool` | ما إذا كان يجب على الوكيل التأمل وإنشاء خطة قبل تنفيذ المهمة. الافتراضي False. |
| **الحد الأقصى لمحاولات الاستدلال** _(اختياري)_ | `max_reasoning_attempts` | `Optional[int]` | الحد الأقصى لمحاولات الاستدلال قبل تنفيذ المهمة. إذا None، سيحاول حتى الاستعداد. |
| **المُضمّن** _(اختياري)_ | `embedder` | `Optional[Dict[str, Any]]` | تهيئة المُضمّن المستخدم من قبل الوكيل. |
| **مصادر المعرفة** _(اختياري)_ | `knowledge_sources` | `Optional[List[BaseKnowledgeSource]]` | مصادر المعرفة المتاحة للوكيل. |
| **استخدام أمر النظام** _(اختياري)_ | `use_system_prompt` | `Optional[bool]` | ما إذا كان يُستخدم أمر النظام (لدعم نموذج o1). الافتراضي True. |
## إنشاء الوكلاء
هناك طريقتان لإنشاء الوكلاء في CrewAI: باستخدام **تهيئة YAML (موصى بها)** أو تعريفهم **مباشرة في الكود**.
### تهيئة YAML (موصى بها)
توفر تهيئة YAML طريقة أنظف وأكثر قابلية للصيانة لتعريف الوكلاء. نوصي بشدة باستخدام هذا النهج في مشاريع CrewAI.
بعد إنشاء مشروع CrewAI كما هو موضح في قسم [التثبيت](/ar/installation)، انتقل إلى ملف `src/latest_ai_development/config/agents.yaml` وعدّل القالب ليتوافق مع متطلباتك.
<Note>
ستُستبدل المتغيرات في ملفات YAML (مثل `{topic}`) بقيم من مدخلاتك عند تشغيل الطاقم:
```python Code
crew.kickoff(inputs={'topic': 'AI Agents'})
```
</Note>
إليك مثالًا على كيفية تهيئة الوكلاء باستخدام YAML:
```yaml agents.yaml
# src/latest_ai_development/config/agents.yaml
researcher:
role: >
{topic} Senior Data Researcher
goal: >
Uncover cutting-edge developments in {topic}
backstory: >
You're a seasoned researcher with a knack for uncovering the latest
developments in {topic}. Known for your ability to find the most relevant
information and present it in a clear and concise manner.
reporting_analyst:
role: >
{topic} Reporting Analyst
goal: >
Create detailed reports based on {topic} data analysis and research findings
backstory: >
You're a meticulous analyst with a keen eye for detail. You're known for
your ability to turn complex data into clear and concise reports, making
it easy for others to understand and act on the information you provide.
```
لاستخدام تهيئة YAML في الكود، أنشئ فئة طاقم ترث من `CrewBase`:
```python Code
# src/latest_ai_development/crew.py
from crewai import Agent, Crew, Process
from crewai.project import CrewBase, agent, crew
from crewai_tools import SerperDevTool
@CrewBase
class LatestAiDevelopmentCrew():
"""LatestAiDevelopment crew"""
agents_config = "config/agents.yaml"
@agent
def researcher(self) -> Agent:
return Agent(
config=self.agents_config['researcher'], # type: ignore[index]
verbose=True,
tools=[SerperDevTool()]
)
@agent
def reporting_analyst(self) -> Agent:
return Agent(
config=self.agents_config['reporting_analyst'], # type: ignore[index]
verbose=True
)
```
<Note>
يجب أن تتطابق الأسماء المستخدمة في ملفات YAML (`agents.yaml`) مع أسماء
الطرق في كود Python.
</Note>
### تعريف مباشر في الكود
يمكنك إنشاء الوكلاء مباشرة في الكود بإنشاء فئة `Agent`. إليك مثالًا شاملًا يوضح جميع المعاملات المتاحة:
```python Code
from crewai import Agent
from crewai_tools import SerperDevTool
# إنشاء وكيل بجميع المعاملات المتاحة
agent = Agent(
role="Senior Data Scientist",
goal="Analyze and interpret complex datasets to provide actionable insights",
backstory="With over 10 years of experience in data science and machine learning, "
"you excel at finding patterns in complex datasets.",
llm="gpt-4",
function_calling_llm=None,
verbose=False,
allow_delegation=False,
max_iter=20,
max_rpm=None,
max_execution_time=None,
max_retry_limit=2,
allow_code_execution=False,
code_execution_mode="safe",
respect_context_window=True,
use_system_prompt=True,
multimodal=False,
inject_date=False,
date_format="%Y-%m-%d",
reasoning=False,
max_reasoning_attempts=None,
tools=[SerperDevTool()],
knowledge_sources=None,
embedder=None,
system_template=None,
prompt_template=None,
response_template=None,
step_callback=None,
)
```
دعنا نستعرض بعض تركيبات المعاملات الرئيسية لحالات الاستخدام الشائعة:
#### وكيل بحث أساسي
```python Code
research_agent = Agent(
role="Research Analyst",
goal="Find and summarize information about specific topics",
backstory="You are an experienced researcher with attention to detail",
tools=[SerperDevTool()],
verbose=True
)
```
#### وكيل تطوير الكود
```python Code
dev_agent = Agent(
role="Senior Python Developer",
goal="Write and debug Python code",
backstory="Expert Python developer with 10 years of experience",
allow_code_execution=True,
code_execution_mode="safe",
max_execution_time=300,
max_retry_limit=3
)
```
#### وكيل تحليل طويل المدى
```python Code
analysis_agent = Agent(
role="Data Analyst",
goal="Perform deep analysis of large datasets",
backstory="Specialized in big data analysis and pattern recognition",
memory=True,
respect_context_window=True,
max_rpm=10,
function_calling_llm="gpt-4o-mini"
)
```
### تفاصيل المعاملات
#### المعاملات الحرجة
- `role` و `goal` و `backstory` مطلوبة وتشكّل سلوك الوكيل
- `llm` يحدد نموذج اللغة المستخدم (افتراضي: GPT-4 من OpenAI)
#### الذاكرة والسياق
- `memory`: تفعيل للحفاظ على سجل المحادثة
- `respect_context_window`: يمنع مشاكل حد الرموز
- `knowledge_sources`: إضافة قواعد معرفة خاصة بالمجال
#### التحكم في التنفيذ
- `max_iter`: الحد الأقصى للمحاولات قبل تقديم أفضل إجابة
- `max_execution_time`: المهلة بالثواني
- `max_rpm`: تحديد معدل استدعاءات API
- `max_retry_limit`: إعادات المحاولة عند الخطأ
#### تنفيذ الكود
- `allow_code_execution`: يجب أن يكون True لتشغيل الكود
- `code_execution_mode`:
- `"safe"`: يستخدم Docker (موصى به للإنتاج)
- `"unsafe"`: تنفيذ مباشر (استخدم فقط في بيئات موثوقة)
<Note>
يشغّل هذا صورة Docker افتراضية. إذا أردت تهيئة صورة Docker،
راجع أداة Code Interpreter في قسم الأدوات. أضف أداة
مفسر الكود كأداة في معامل أداة الوكيل.
</Note>
#### الميزات المتقدمة
- `multimodal`: تفعيل القدرات متعددة الوسائط لمعالجة النص والمحتوى المرئي
- `reasoning`: تمكين الوكيل من التأمل وإنشاء خطط قبل تنفيذ المهام
- `inject_date`: حقن التاريخ الحالي تلقائيًا في أوصاف المهام
#### القوالب
- `system_template`: يحدد السلوك الأساسي للوكيل
- `prompt_template`: ينظم تنسيق الإدخال
- `response_template`: ينسّق استجابات الوكيل
<Note>
عند استخدام القوالب المخصصة، تأكد من تعريف كل من `system_template` و
`prompt_template`. `response_template` اختياري لكن يُوصى به
لتنسيق مخرجات متسق.
</Note>
## أدوات الوكيل
يمكن تجهيز الوكلاء بأدوات متنوعة لتعزيز قدراتهم. يدعم CrewAI أدوات من:
- [مجموعة أدوات CrewAI](https://github.com/joaomdmoura/crewai-tools)
- [أدوات LangChain](https://python.langchain.com/docs/integrations/tools)
إليك كيفية إضافة أدوات لوكيل:
```python Code
from crewai import Agent
from crewai_tools import SerperDevTool, WikipediaTools
# إنشاء الأدوات
search_tool = SerperDevTool()
wiki_tool = WikipediaTools()
# إضافة أدوات للوكيل
researcher = Agent(
role="AI Technology Researcher",
goal="Research the latest AI developments",
tools=[search_tool, wiki_tool],
verbose=True
)
```
## التفاعل المباشر مع الوكيل عبر `kickoff()`
يمكن استخدام الوكلاء مباشرة بدون المرور بمهمة أو سير عمل طاقم باستخدام طريقة `kickoff()`. يوفر هذا طريقة أبسط للتفاعل مع وكيل عندما لا تحتاج إلى إمكانيات تنسيق الطاقم الكاملة.
```python Code
from crewai import Agent
from crewai_tools import SerperDevTool
# إنشاء وكيل
researcher = Agent(
role="AI Technology Researcher",
goal="Research the latest AI developments",
tools=[SerperDevTool()],
verbose=True
)
# استخدام kickoff() للتفاعل مباشرة مع الوكيل
result = researcher.kickoff("What are the latest developments in language models?")
# الوصول إلى الاستجابة الخام
print(result.raw)
```
## اعتبارات مهمة وأفضل الممارسات
### الأمان وتنفيذ الكود
- عند استخدام `allow_code_execution`، كن حذرًا مع مدخلات المستخدم وتحقق منها دائمًا
- استخدم `code_execution_mode: "safe"` (Docker) في بيئات الإنتاج
- فكّر في تعيين حدود `max_execution_time` مناسبة لمنع الحلقات اللانهائية
### تحسين الأداء
- استخدم `respect_context_window: true` لمنع مشاكل حد الرموز
- عيّن `max_rpm` مناسبًا لتجنب تحديد المعدل
- فعّل `cache: true` لتحسين الأداء للمهام المتكررة
- اضبط `max_iter` و `max_retry_limit` بناءً على تعقيد المهمة
### إدارة الذاكرة والسياق
- استفد من `knowledge_sources` للمعلومات الخاصة بالمجال
- هيّئ `embedder` عند استخدام نماذج تضمين مخصصة
- استخدم القوالب المخصصة للتحكم الدقيق في سلوك الوكيل
### التعاون بين الوكلاء
- فعّل `allow_delegation: true` عندما يحتاج الوكلاء للعمل معًا
- استخدم `step_callback` لمراقبة وتسجيل تفاعلات الوكلاء
- فكّر في استخدام نماذج LLM مختلفة لأغراض مختلفة
### توافق النموذج
- عيّن `use_system_prompt: false` للنماذج القديمة التي لا تدعم رسائل النظام
- تأكد من أن `llm` المختار يدعم الميزات التي تحتاجها

287
docs/ar/concepts/cli.mdx Normal file
View File

@@ -0,0 +1,287 @@
---
title: واجهة سطر الأوامر
description: تعرّف على كيفية استخدام واجهة سطر أوامر CrewAI للتفاعل مع CrewAI.
icon: terminal
mode: "wide"
---
<Warning>
منذ الإصدار 0.140.0، بدأ CrewAI AMP عملية نقل مزود تسجيل الدخول.
لذلك، تم تحديث تدفق المصادقة عبر CLI. المستخدمون الذين يسجلون الدخول
باستخدام Google، أو الذين أنشأوا حساباتهم بعد 3 يوليو 2025 لن يتمكنوا
من تسجيل الدخول مع الإصدارات القديمة من مكتبة `crewai`.
</Warning>
## نظرة عامة
توفر واجهة سطر أوامر CrewAI مجموعة من الأوامر للتفاعل مع CrewAI، مما يتيح لك إنشاء وتدريب وتشغيل وإدارة الأطقم والتدفقات.
## التثبيت
لاستخدام واجهة سطر أوامر CrewAI، تأكد من تثبيت CrewAI:
```shell Terminal
pip install crewai
```
## الاستخدام الأساسي
الهيكل الأساسي لأمر CrewAI CLI هو:
```shell Terminal
crewai [COMMAND] [OPTIONS] [ARGUMENTS]
```
## الأوامر المتاحة
### 1. إنشاء
إنشاء طاقم أو تدفق جديد.
```shell Terminal
crewai create [OPTIONS] TYPE NAME
```
- `TYPE`: اختر بين "crew" أو "flow"
- `NAME`: اسم الطاقم أو التدفق
مثال:
```shell Terminal
crewai create crew my_new_crew
crewai create flow my_new_flow
```
### 2. الإصدار
عرض الإصدار المثبت من CrewAI.
```shell Terminal
crewai version [OPTIONS]
```
- `--tools`: (اختياري) عرض الإصدار المثبت من أدوات CrewAI
### 3. التدريب
تدريب الطاقم لعدد محدد من التكرارات.
```shell Terminal
crewai train [OPTIONS]
```
- `-n, --n_iterations INTEGER`: عدد تكرارات التدريب (افتراضي: 5)
- `-f, --filename TEXT`: مسار ملف مخصص للتدريب (افتراضي: "trained_agents_data.pkl")
### 4. الإعادة
إعادة تنفيذ الطاقم من مهمة محددة.
```shell Terminal
crewai replay [OPTIONS]
```
- `-t, --task_id TEXT`: إعادة تنفيذ الطاقم من معرّف المهمة هذا، بما في ذلك جميع المهام اللاحقة
### 5. سجل مخرجات المهام
استرجاع أحدث مخرجات مهام crew.kickoff().
```shell Terminal
crewai log-tasks-outputs
```
### 6. إعادة تعيين الذاكرة
إعادة تعيين ذاكرة الطاقم (طويلة، قصيرة، الكيانات، أحدث مخرجات التشغيل).
```shell Terminal
crewai reset-memories [OPTIONS]
```
- `-l, --long`: إعادة تعيين الذاكرة طويلة المدى
- `-s, --short`: إعادة تعيين الذاكرة قصيرة المدى
- `-e, --entities`: إعادة تعيين ذاكرة الكيانات
- `-k, --kickoff-outputs`: إعادة تعيين أحدث مخرجات التشغيل
- `-kn, --knowledge`: إعادة تعيين تخزين المعرفة
- `-akn, --agent-knowledge`: إعادة تعيين تخزين معرفة الوكيل
- `-a, --all`: إعادة تعيين جميع الذاكرات
### 7. الاختبار
اختبار الطاقم وتقييم النتائج.
```shell Terminal
crewai test [OPTIONS]
```
- `-n, --n_iterations INTEGER`: عدد تكرارات الاختبار (افتراضي: 3)
- `-m, --model TEXT`: نموذج LLM لتشغيل الاختبارات (افتراضي: "gpt-4o-mini")
### 8. التشغيل
تشغيل الطاقم أو التدفق.
```shell Terminal
crewai run
```
<Note>
بدءًا من الإصدار 0.103.0، يمكن استخدام أمر `crewai run` لتشغيل
كل من الأطقم القياسية والتدفقات. للتدفقات، يكتشف تلقائيًا النوع
من pyproject.toml ويشغّل الأمر المناسب. هذه هي الطريقة الموصى بها
لتشغيل كل من الأطقم والتدفقات.
</Note>
### 9. الدردشة
بدءًا من الإصدار `0.98.0`، عند تشغيل أمر `crewai chat`، تبدأ جلسة تفاعلية مع طاقمك. سيرشدك المساعد الذكي بطلب المدخلات اللازمة لتنفيذ الطاقم. بمجرد توفير جميع المدخلات، سينفذ الطاقم مهامه.
```shell Terminal
crewai chat
```
<Note>
مهم: عيّن خاصية `chat_llm` في ملف `crew.py` لتفعيل هذا الأمر.
```python
@crew
def crew(self) -> Crew:
return Crew(
agents=self.agents,
tasks=self.tasks,
process=Process.sequential,
verbose=True,
chat_llm="gpt-4o",
)
```
</Note>
### 10. النشر
نشر الطاقم أو التدفق إلى [CrewAI AMP](https://app.crewai.com).
- **المصادقة**: تحتاج لتكون مصادقًا للنشر إلى CrewAI AMP.
```shell Terminal
crewai login
```
- **إنشاء نشر**:
```shell Terminal
crewai deploy create
```
- **نشر الطاقم**:
```shell Terminal
crewai deploy push
```
- **حالة النشر**:
```shell Terminal
crewai deploy status
```
- **سجلات النشر**:
```shell Terminal
crewai deploy logs
```
- **عرض النشرات**:
```shell Terminal
crewai deploy list
```
- **حذف النشر**:
```shell Terminal
crewai deploy remove
```
### 11. إدارة المؤسسة
إدارة مؤسسات CrewAI AMP.
```shell Terminal
crewai org [COMMAND] [OPTIONS]
```
- `list`: عرض جميع المؤسسات
- `current`: عرض المؤسسة النشطة حاليًا
- `switch`: التبديل إلى مؤسسة محددة
### 12. تسجيل الدخول
المصادقة مع CrewAI AMP باستخدام تدفق رمز الجهاز الآمن.
```shell Terminal
crewai login
```
### 13. إدارة التهيئة
إدارة إعدادات تهيئة CLI لـ CrewAI.
```shell Terminal
crewai config [COMMAND] [OPTIONS]
```
- `list`: عرض جميع معاملات التهيئة
- `set`: تعيين معامل تهيئة
- `reset`: إعادة تعيين جميع المعاملات إلى القيم الافتراضية
### 14. إدارة التتبع
إدارة تفضيلات جمع التتبع لعمليات الطاقم والتدفق.
```shell Terminal
crewai traces [COMMAND]
```
- `enable`: تفعيل جمع التتبع
- `disable`: تعطيل جمع التتبع
- `status`: عرض حالة جمع التتبع الحالية
#### كيف يعمل التتبع
يتم التحكم في جمع التتبع بفحص ثلاثة إعدادات بترتيب الأولوية:
1. **علامة صريحة في الكود** (الأولوية الأعلى):
```python
crew = Crew(agents=[...], tasks=[...], tracing=True) # تفعيل دائمًا
crew = Crew(agents=[...], tasks=[...], tracing=False) # تعطيل دائمًا
crew = Crew(agents=[...], tasks=[...]) # فحص الأولويات الأدنى
```
2. **متغير البيئة** (الأولوية الثانية):
```env
CREWAI_TRACING_ENABLED=true
```
3. **تفضيل المستخدم** (الأولوية الأدنى):
```shell Terminal
crewai traces enable
```
<Note>
**لتفعيل التتبع**، استخدم أيًا من هذه الطرق:
- عيّن `tracing=True` في كود الطاقم/التدفق، أو
- أضف `CREWAI_TRACING_ENABLED=true` إلى ملف `.env`، أو
- شغّل `crewai traces enable`
**لتعطيل التتبع**، استخدم أيًا من هذه الطرق:
- عيّن `tracing=False` في كود الطاقم/التدفق، أو
- أزل أو عيّن `false` لمتغير `CREWAI_TRACING_ENABLED`، أو
- شغّل `crewai traces disable`
</Note>
<Tip>
يتعامل CrewAI CLI مع المصادقة لمستودع الأدوات تلقائيًا عند
إضافة حزم إلى مشروعك. فقط أضف `crewai` قبل أي أمر `uv`
لاستخدامه. مثلًا `crewai uv add requests`.
</Tip>
<Note>
تُخزن إعدادات التهيئة في `~/.config/crewai/settings.json`. بعض
الإعدادات مثل اسم المؤسسة ومعرّفها للقراءة فقط وتُدار من خلال
أوامر المصادقة والمؤسسة.
</Note>

View File

@@ -0,0 +1,363 @@
---
title: التعاون
description: كيفية تمكين الوكلاء من العمل معًا وتفويض المهام والتواصل بفعالية داخل فرق CrewAI.
icon: screen-users
mode: "wide"
---
## نظرة عامة
يُمكّن التعاون في CrewAI الوكلاء من العمل معًا كفريق عن طريق تفويض المهام وطرح الأسئلة للاستفادة من خبرات بعضهم البعض. عندما يكون `allow_delegation=True`، يحصل الوكلاء تلقائيًا على أدوات تعاون قوية.
## البدء السريع: تفعيل التعاون
```python
from crewai import Agent, Crew, Task
# تفعيل التعاون للوكلاء
researcher = Agent(
role="Research Specialist",
goal="Conduct thorough research on any topic",
backstory="Expert researcher with access to various sources",
allow_delegation=True, # الإعداد الرئيسي للتعاون
verbose=True
)
writer = Agent(
role="Content Writer",
goal="Create engaging content based on research",
backstory="Skilled writer who transforms research into compelling content",
allow_delegation=True, # يُمكّن طرح الأسئلة على الوكلاء الآخرين
verbose=True
)
# يمكن للوكلاء الآن التعاون تلقائيًا
crew = Crew(
agents=[researcher, writer],
tasks=[...],
verbose=True
)
```
## كيف يعمل تعاون الوكلاء
عندما يكون `allow_delegation=True`، يوفر CrewAI تلقائيًا للوكلاء أداتين قويتين:
### 1. **أداة تفويض العمل**
تسمح للوكلاء بتعيين مهام لزملاء الفريق ذوي الخبرة المحددة.
```python
# يحصل الوكيل تلقائيًا على هذه الأداة:
# Delegate work to coworker(task: str, context: str, coworker: str)
```
### 2. **أداة طرح الأسئلة**
تُمكّن الوكلاء من طرح أسئلة محددة لجمع المعلومات من الزملاء.
```python
# يحصل الوكيل تلقائيًا على هذه الأداة:
# Ask question to coworker(question: str, context: str, coworker: str)
```
## التعاون في الممارسة
إليك مثالًا كاملًا يوضح تعاون الوكلاء في مهمة إنشاء المحتوى:
```python
from crewai import Agent, Crew, Task, Process
# إنشاء وكلاء تعاونيين
researcher = Agent(
role="Research Specialist",
goal="Find accurate, up-to-date information on any topic",
backstory="""You're a meticulous researcher with expertise in finding
reliable sources and fact-checking information across various domains.""",
allow_delegation=True,
verbose=True
)
writer = Agent(
role="Content Writer",
goal="Create engaging, well-structured content",
backstory="""You're a skilled content writer who excels at transforming
research into compelling, readable content for different audiences.""",
allow_delegation=True,
verbose=True
)
editor = Agent(
role="Content Editor",
goal="Ensure content quality and consistency",
backstory="""You're an experienced editor with an eye for detail,
ensuring content meets high standards for clarity and accuracy.""",
allow_delegation=True,
verbose=True
)
# إنشاء مهمة تشجع التعاون
article_task = Task(
description="""Write a comprehensive 1000-word article about 'The Future of AI in Healthcare'.
The article should include:
- Current AI applications in healthcare
- Emerging trends and technologies
- Potential challenges and ethical considerations
- Expert predictions for the next 5 years
Collaborate with your teammates to ensure accuracy and quality.""",
expected_output="A well-researched, engaging 1000-word article with proper structure and citations",
agent=writer # الكاتب يقود، لكن يمكنه تفويض البحث إلى الباحث
)
# إنشاء طاقم تعاوني
crew = Crew(
agents=[researcher, writer, editor],
tasks=[article_task],
process=Process.sequential,
verbose=True
)
result = crew.kickoff()
```
## أنماط التعاون
### النمط 1: بحث ← كتابة ← تحرير
```python
research_task = Task(
description="Research the latest developments in quantum computing",
expected_output="Comprehensive research summary with key findings and sources",
agent=researcher
)
writing_task = Task(
description="Write an article based on the research findings",
expected_output="Engaging 800-word article about quantum computing",
agent=writer,
context=[research_task] # يحصل على مخرجات البحث كسياق
)
editing_task = Task(
description="Edit and polish the article for publication",
expected_output="Publication-ready article with improved clarity and flow",
agent=editor,
context=[writing_task] # يحصل على مسودة المقال كسياق
)
```
### النمط 2: مهمة واحدة تعاونية
```python
collaborative_task = Task(
description="""Create a marketing strategy for a new AI product.
Writer: Focus on messaging and content strategy
Researcher: Provide market analysis and competitor insights
Work together to create a comprehensive strategy.""",
expected_output="Complete marketing strategy with research backing",
agent=writer # الوكيل القائد، لكن يمكنه التفويض إلى الباحث
)
```
## التعاون الهرمي
للمشاريع المعقدة، استخدم عملية هرمية مع وكيل مدير:
```python
from crewai import Agent, Crew, Task, Process
# وكيل المدير ينسق الفريق
manager = Agent(
role="Project Manager",
goal="Coordinate team efforts and ensure project success",
backstory="Experienced project manager skilled at delegation and quality control",
allow_delegation=True,
verbose=True
)
# وكلاء متخصصون
researcher = Agent(
role="Researcher",
goal="Provide accurate research and analysis",
backstory="Expert researcher with deep analytical skills",
allow_delegation=False, # المتخصصون يركزون على خبرتهم
verbose=True
)
writer = Agent(
role="Writer",
goal="Create compelling content",
backstory="Skilled writer who creates engaging content",
allow_delegation=False,
verbose=True
)
# مهمة يقودها المدير
project_task = Task(
description="Create a comprehensive market analysis report with recommendations",
expected_output="Executive summary, detailed analysis, and strategic recommendations",
agent=manager # المدير سيفوّض إلى المتخصصين
)
# طاقم هرمي
crew = Crew(
agents=[manager, researcher, writer],
tasks=[project_task],
process=Process.hierarchical, # المدير ينسق كل شيء
manager_llm="gpt-4o", # تحديد LLM للمدير
verbose=True
)
```
## أفضل ممارسات التعاون
### 1. **تحديد الأدوار بوضوح**
```python
# جيد: أدوار محددة ومتكاملة
researcher = Agent(role="Market Research Analyst", ...)
writer = Agent(role="Technical Content Writer", ...)
# تجنب: أدوار متداخلة أو غامضة
agent1 = Agent(role="General Assistant", ...)
agent2 = Agent(role="Helper", ...)
```
### 2. **تفعيل التفويض الاستراتيجي**
```python
# فعّل التفويض للمنسقين والعامين
lead_agent = Agent(
role="Content Lead",
allow_delegation=True, # يمكنه التفويض إلى المتخصصين
...
)
# عطّل للمتخصصين المركّزين (اختياري)
specialist_agent = Agent(
role="Data Analyst",
allow_delegation=False, # يركز على الخبرة الأساسية
...
)
```
### 3. **مشاركة السياق**
```python
# استخدم معامل context لاعتماديات المهام
writing_task = Task(
description="Write article based on research",
agent=writer,
context=[research_task], # يشارك نتائج البحث
...
)
```
### 4. **أوصاف المهام الواضحة**
```python
# أوصاف محددة وقابلة للتنفيذ
Task(
description="""Research competitors in the AI chatbot space.
Focus on: pricing models, key features, target markets.
Provide data in a structured format.""",
...
)
# تجنب: أوصاف غامضة لا توجه التعاون
Task(description="Do some research about chatbots", ...)
```
## استكشاف أخطاء التعاون وإصلاحها
### المشكلة: الوكلاء لا يتعاونون
**الأعراض:** يعمل الوكلاء بمعزل، لا يحدث تفويض
```python
# الحل: تأكد من تفعيل التفويض
agent = Agent(
role="...",
allow_delegation=True, # هذا مطلوب!
...
)
```
### المشكلة: كثرة الذهاب والإياب
**الأعراض:** يطرح الوكلاء أسئلة مفرطة، تقدم بطيء
```python
# الحل: وفّر سياقًا أفضل وأدوارًا محددة
Task(
description="""Write a technical blog post about machine learning.
Context: Target audience is software developers with basic ML knowledge.
Length: 1200 words
Include: code examples, practical applications, best practices
If you need specific technical details, delegate research to the researcher.""",
...
)
```
### المشكلة: حلقات التفويض
**الأعراض:** يفوّض الوكلاء ذهابًا وإيابًا بلا نهاية
```python
# الحل: تسلسل هرمي واضح ومسؤوليات
manager = Agent(role="Manager", allow_delegation=True)
specialist1 = Agent(role="Specialist A", allow_delegation=False) # لا إعادة تفويض
specialist2 = Agent(role="Specialist B", allow_delegation=False)
```
## ميزات التعاون المتقدمة
### قواعد التعاون المخصصة
```python
# تعيين إرشادات تعاون محددة في خلفية الوكيل
agent = Agent(
role="Senior Developer",
backstory="""You lead development projects and coordinate with team members.
Collaboration guidelines:
- Delegate research tasks to the Research Analyst
- Ask the Designer for UI/UX guidance
- Consult the QA Engineer for testing strategies
- Only escalate blocking issues to the Project Manager""",
allow_delegation=True
)
```
### مراقبة التعاون
```python
def track_collaboration(output):
"""تتبع أنماط التعاون"""
if "Delegate work to coworker" in output.raw:
print("Delegation occurred")
if "Ask question to coworker" in output.raw:
print("Question asked")
crew = Crew(
agents=[...],
tasks=[...],
step_callback=track_collaboration, # مراقبة التعاون
verbose=True
)
```
## الذاكرة والتعلم
تمكين الوكلاء من تذكر التعاونات السابقة:
```python
agent = Agent(
role="Content Lead",
memory=True, # يتذكر التفاعلات السابقة
allow_delegation=True,
verbose=True
)
```
مع تفعيل الذاكرة، يتعلم الوكلاء من التعاونات السابقة ويحسّنون قرارات التفويض بمرور الوقت.
## الخطوات التالية
- **جرّب الأمثلة**: ابدأ بمثال التعاون الأساسي
- **جرّب أدوارًا مختلفة**: اختبر تركيبات أدوار وكلاء مختلفة
- **راقب التفاعلات**: استخدم `verbose=True` لرؤية التعاون في العمل
- **حسّن أوصاف المهام**: المهام الواضحة تؤدي إلى تعاون أفضل
- **وسّع النطاق**: جرّب العمليات الهرمية للمشاريع المعقدة
يحوّل التعاون وكلاء الذكاء الاصطناعي الفرديين إلى فرق قوية يمكنها معالجة التحديات المعقدة ومتعددة الأوجه معًا.

204
docs/ar/concepts/crews.mdx Normal file
View File

@@ -0,0 +1,204 @@
---
title: الأطقم
description: فهم واستخدام الأطقم في إطار عمل CrewAI مع خصائص ووظائف شاملة.
icon: people-group
mode: "wide"
---
## نظرة عامة
يمثل الطاقم في CrewAI مجموعة تعاونية من الوكلاء يعملون معًا لتحقيق مجموعة من المهام. يحدد كل طاقم استراتيجية تنفيذ المهام وتعاون الوكلاء وسير العمل العام.
## خصائص الطاقم
| الخاصية | المعامل | الوصف |
| :------------------------------------ | :--------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **المهام** | `tasks` | قائمة المهام المعيّنة للطاقم. |
| **الوكلاء** | `agents` | قائمة الوكلاء الذين يشكلون جزءًا من الطاقم. |
| **العملية** _(اختياري)_ | `process` | تدفق العملية (مثل تسلسلي، هرمي) الذي يتبعه الطاقم. الافتراضي `sequential`. |
| **الوضع المفصل** _(اختياري)_ | `verbose` | مستوى التفصيل في التسجيل أثناء التنفيذ. الافتراضي `False`. |
| **LLM المدير** _(اختياري)_ | `manager_llm` | نموذج اللغة المستخدم بواسطة وكيل المدير في العملية الهرمية. **مطلوب عند استخدام العملية الهرمية.** |
| **LLM استدعاء الدوال** _(اختياري)_ | `function_calling_llm` | إذا مُرر، سيستخدم الطاقم هذا LLM لاستدعاء دوال الأدوات لجميع الوكلاء. يمكن لكل وكيل أن يكون له LLM خاص يتجاوز LLM الطاقم. |
| **التهيئة** _(اختياري)_ | `config` | إعدادات تهيئة اختيارية للطاقم، بتنسيق `Json` أو `Dict[str, Any]`. |
| **الحد الأقصى لـ RPM** _(اختياري)_ | `max_rpm` | الحد الأقصى للطلبات في الدقيقة. الافتراضي `None`. |
| **الذاكرة** _(اختياري)_ | `memory` | تُستخدم لتخزين ذاكرات التنفيذ (قصيرة المدى، طويلة المدى، ذاكرة الكيانات). |
| **التخزين المؤقت** _(اختياري)_ | `cache` | يحدد ما إذا كان يُستخدم تخزين مؤقت لنتائج تنفيذ الأدوات. الافتراضي `True`. |
| **المُضمّن** _(اختياري)_ | `embedder` | تهيئة المُضمّن المستخدم من قبل الطاقم. الافتراضي `{"provider": "openai"}`. |
| **دالة الخطوة** _(اختياري)_ | `step_callback` | دالة تُستدعى بعد كل خطوة لكل وكيل. |
| **دالة المهمة** _(اختياري)_ | `task_callback` | دالة تُستدعى بعد اكتمال كل مهمة. |
| **مشاركة الطاقم** _(اختياري)_ | `share_crew` | ما إذا كنت تريد مشاركة معلومات الطاقم الكاملة وتنفيذه مع فريق CrewAI. |
| **ملف سجل المخرجات** _(اختياري)_ | `output_log_file` | عيّن True لحفظ السجلات كـ logs.txt أو وفّر مسار ملف. الافتراضي `None`. |
| **وكيل المدير** _(اختياري)_ | `manager_agent` | يعيّن وكيلًا مخصصًا سيُستخدم كمدير. |
| **التخطيط** *(اختياري)* | `planning` | يضيف قدرة التخطيط للطاقم. |
| **LLM التخطيط** *(اختياري)* | `planning_llm` | نموذج اللغة المستخدم بواسطة AgentPlanner في عملية التخطيط. |
| **مصادر المعرفة** _(اختياري)_ | `knowledge_sources` | مصادر المعرفة المتاحة على مستوى الطاقم، يمكن لجميع الوكلاء الوصول إليها. |
| **البث** _(اختياري)_ | `stream` | تفعيل مخرجات البث لتلقي تحديثات في الوقت الفعلي. الافتراضي `False`. |
<Tip>
**الحد الأقصى لـ RPM للطاقم**: تعيّن خاصية `max_rpm` الحد الأقصى للطلبات في الدقيقة التي يمكن للطاقم تنفيذها لتجنب حدود المعدل وستتجاوز إعدادات `max_rpm` الفردية للوكلاء إذا عيّنتها.
</Tip>
## إنشاء الأطقم
هناك طريقتان لإنشاء الأطقم في CrewAI: باستخدام **تهيئة YAML (موصى بها)** أو تعريفها **مباشرة في الكود**.
### تهيئة YAML (موصى بها)
توفر تهيئة YAML طريقة أنظف وأكثر قابلية للصيانة لتعريف الأطقم وتتسق مع كيفية تعريف الوكلاء والمهام في مشاريع CrewAI.
```python code
from crewai import Agent, Crew, Task, Process
from crewai.project import CrewBase, agent, task, crew, before_kickoff, after_kickoff
from crewai.agents.agent_builder.base_agent import BaseAgent
from typing import List
@CrewBase
class YourCrewName:
"""Description of your crew"""
agents: List[BaseAgent]
tasks: List[Task]
agents_config = 'config/agents.yaml'
tasks_config = 'config/tasks.yaml'
@before_kickoff
def prepare_inputs(self, inputs):
inputs['additional_data'] = "Some extra information"
return inputs
@after_kickoff
def process_output(self, output):
output.raw += "\nProcessed after kickoff."
return output
@agent
def agent_one(self) -> Agent:
return Agent(
config=self.agents_config['agent_one'], # type: ignore[index]
verbose=True
)
@task
def task_one(self) -> Task:
return Task(
config=self.tasks_config['task_one'] # type: ignore[index]
)
@crew
def crew(self) -> Crew:
return Crew(
agents=self.agents,
tasks=self.tasks,
process=Process.sequential,
verbose=True,
)
```
<Note>
سيتم تنفيذ المهام بالترتيب الذي عُرّفت به.
</Note>
فئة `CrewBase`، مع هذه المزيّنات، تؤتمت جمع الوكلاء والمهام، مما يقلل الحاجة للإدارة اليدوية.
### تعريف مباشر في الكود (بديل)
بدلاً من ذلك، يمكنك تعريف الطاقم مباشرة في الكود بدون ملفات تهيئة YAML.
## مخرجات الطاقم
تُغلّف مخرجات الطاقم في فئة `CrewOutput`. توفر هذه الفئة طريقة منظمة للوصول إلى نتائج تنفيذ الطاقم، بما في ذلك تنسيقات متنوعة مثل السلاسل النصية الخام وJSON ونماذج Pydantic.
### خصائص مخرجات الطاقم
| الخاصية | المعامل | النوع | الوصف |
| :--------------- | :------------- | :------------------------- | :--------------------------------------------------------------------------------------------------- |
| **Raw** | `raw` | `str` | المخرجات الخام للطاقم. هذا هو التنسيق الافتراضي. |
| **Pydantic** | `pydantic` | `Optional[BaseModel]` | كائن نموذج Pydantic يمثل المخرجات المنظمة. |
| **JSON Dict** | `json_dict` | `Optional[Dict[str, Any]]` | قاموس يمثل مخرجات JSON. |
| **Tasks Output** | `tasks_output` | `List[TaskOutput]` | قائمة كائنات `TaskOutput`، كل منها يمثل مخرجات مهمة. |
| **Token Usage** | `token_usage` | `Dict[str, Any]` | ملخص استخدام الرموز. |
## استخدام الذاكرة
يمكن للأطقم استخدام الذاكرة (قصيرة المدى، طويلة المدى، وذاكرة الكيانات) لتحسين تنفيذها وتعلمها بمرور الوقت.
## استخدام التخزين المؤقت
يمكن استخدام التخزين المؤقت لتخزين نتائج تنفيذ الأدوات، مما يجعل العملية أكثر كفاءة.
## مقاييس استخدام الطاقم
بعد تنفيذ الطاقم، يمكنك الوصول إلى خاصية `usage_metrics` لعرض مقاييس استخدام نموذج اللغة (LLM) لجميع المهام المنفذة.
```python Code
crew = Crew(agents=[agent1, agent2], tasks=[task1, task2])
crew.kickoff()
print(crew.usage_metrics)
```
## عملية تنفيذ الطاقم
- **العملية التسلسلية**: تُنفذ المهام واحدة تلو الأخرى، مما يسمح بتدفق عمل خطي.
- **العملية الهرمية**: ينسق وكيل مدير الطاقم، ويفوّض المهام ويتحقق من النتائج.
### تشغيل الطاقم
بمجرد تجميع طاقمك، ابدأ سير العمل بطريقة `kickoff()`.
```python Code
result = my_crew.kickoff()
print(result)
```
### طرق مختلفة لتشغيل الطاقم
#### الطرق المتزامنة
- `kickoff()`: يبدأ عملية التنفيذ وفقًا لتدفق العملية المحدد.
- `kickoff_for_each()`: ينفذ المهام بالتتابع لكل مدخل.
#### الطرق غير المتزامنة
| الطريقة | النوع | الوصف |
|--------|------|-------------|
| `akickoff()` | غير متزامن أصلي | async/await أصلي عبر سلسلة التنفيذ بأكملها |
| `akickoff_for_each()` | غير متزامن أصلي | تنفيذ غير متزامن أصلي لكل مدخل في قائمة |
| `kickoff_async()` | مبني على الخيوط | يغلّف التنفيذ المتزامن في `asyncio.to_thread` |
| `kickoff_for_each_async()` | مبني على الخيوط | غير متزامن مبني على الخيوط لكل مدخل في قائمة |
<Note>
لأحمال العمل عالية التزامن، يُوصى بـ `akickoff()` و `akickoff_for_each()` لأنها تستخدم async أصلي.
</Note>
### بث تنفيذ الطاقم
للرؤية في الوقت الفعلي لتنفيذ الطاقم، يمكنك تفعيل البث:
```python Code
crew = Crew(
agents=[researcher],
tasks=[task],
stream=True
)
streaming = crew.kickoff(inputs={"topic": "AI"})
for chunk in streaming:
print(chunk.content, end="", flush=True)
result = streaming.result
```
### الإعادة من مهمة محددة
يمكنك الآن الإعادة من مهمة محددة باستخدام أمر CLI `replay`.
```shell
crewai log-tasks-outputs
```
ثم للإعادة من مهمة محددة:
```shell
crewai replay -t <task_id>
```

View File

@@ -0,0 +1,236 @@
---
title: "مستمعو الأحداث"
description: "الاستفادة من أحداث CrewAI لبناء تكاملات مخصصة ومراقبة"
icon: spinner
mode: "wide"
---
## نظرة عامة
يوفر CrewAI نظام أحداث قوي يتيح لك الاستماع والتفاعل مع الأحداث المختلفة التي تحدث أثناء تنفيذ طاقمك. تُمكّنك هذه الميزة من بناء تكاملات مخصصة وحلول مراقبة وأنظمة تسجيل أو أي وظائف أخرى تحتاج للتشغيل بناءً على أحداث CrewAI الداخلية.
## كيف يعمل
يستخدم CrewAI بنية ناقل أحداث لإرسال الأحداث طوال دورة حياة التنفيذ. يُبنى نظام الأحداث على المكونات التالية:
1. **CrewAIEventsBus**: ناقل أحداث فريد يدير تسجيل الأحداث وإرسالها
2. **BaseEvent**: الفئة الأساسية لجميع الأحداث في النظام
3. **BaseEventListener**: فئة أساسية مجردة لإنشاء مستمعي أحداث مخصصين
عندما تحدث إجراءات محددة في CrewAI (مثل بدء تنفيذ طاقم، أو إكمال وكيل لمهمة، أو استخدام أداة)، يرسل النظام أحداثًا مقابلة. يمكنك تسجيل معالجات لهذه الأحداث لتنفيذ كود مخصص عند حدوثها.
<Note type="info" title="تحسين المؤسسات: تتبع الأوامر">
يوفر CrewAI AMP ميزة تتبع أوامر مدمجة تستفيد من نظام الأحداث لتتبع وتخزين وتصور جميع الأوامر والاستكمالات والبيانات الوصفية المرتبطة.
![Prompt Tracing Dashboard](/images/enterprise/traces-overview.png)
مع تتبع الأوامر يمكنك:
- عرض السجل الكامل لجميع الأوامر المرسلة إلى LLM
- تتبع استخدام الرموز والتكاليف
- تصحيح إخفاقات استدلال الوكيل
- مشاركة تسلسلات الأوامر مع فريقك
- مقارنة استراتيجيات الأوامر المختلفة
- تصدير التتبعات للامتثال والتدقيق
</Note>
## إنشاء مستمع أحداث مخصص
لإنشاء مستمع أحداث مخصص، تحتاج إلى:
1. إنشاء فئة ترث من `BaseEventListener`
2. تنفيذ طريقة `setup_listeners`
3. تسجيل معالجات للأحداث التي تهمك
4. إنشاء مثيل من مستمعك في الملف المناسب
إليك مثالًا بسيطًا:
```python
from crewai.events import (
CrewKickoffStartedEvent,
CrewKickoffCompletedEvent,
AgentExecutionCompletedEvent,
)
from crewai.events import BaseEventListener
class MyCustomListener(BaseEventListener):
def __init__(self):
super().__init__()
def setup_listeners(self, crewai_event_bus):
@crewai_event_bus.on(CrewKickoffStartedEvent)
def on_crew_started(source, event):
print(f"Crew '{event.crew_name}' has started execution!")
@crewai_event_bus.on(CrewKickoffCompletedEvent)
def on_crew_completed(source, event):
print(f"Crew '{event.crew_name}' has completed execution!")
print(f"Output: {event.output}")
@crewai_event_bus.on(AgentExecutionCompletedEvent)
def on_agent_execution_completed(source, event):
print(f"Agent '{event.agent.role}' completed task")
print(f"Output: {event.output}")
```
## تسجيل المستمع بشكل صحيح
مجرد تعريف فئة المستمع ليس كافيًا. تحتاج لإنشاء مثيل منه والتأكد من استيراده في تطبيقك.
```python
# في ملف crew.py
from crewai import Agent, Crew, Task
from my_listeners import MyCustomListener
# إنشاء مثيل من المستمع
my_listener = MyCustomListener()
class MyCustomCrew:
def crew(self):
return Crew(
agents=[...],
tasks=[...],
)
```
## أنواع الأحداث المتاحة
يوفر CrewAI مجموعة واسعة من الأحداث يمكنك الاستماع إليها:
### أحداث الطاقم
- **CrewKickoffStartedEvent**: يُرسل عند بدء تنفيذ الطاقم
- **CrewKickoffCompletedEvent**: يُرسل عند اكتمال تنفيذ الطاقم
- **CrewKickoffFailedEvent**: يُرسل عند فشل تنفيذ الطاقم
- **CrewTestStartedEvent**: يُرسل عند بدء اختبار الطاقم
- **CrewTestCompletedEvent**: يُرسل عند اكتمال اختبار الطاقم
- **CrewTestFailedEvent**: يُرسل عند فشل اختبار الطاقم
- **CrewTrainStartedEvent**: يُرسل عند بدء تدريب الطاقم
- **CrewTrainCompletedEvent**: يُرسل عند اكتمال تدريب الطاقم
- **CrewTrainFailedEvent**: يُرسل عند فشل تدريب الطاقم
### أحداث الوكيل
- **AgentExecutionStartedEvent**: يُرسل عند بدء تنفيذ وكيل لمهمة
- **AgentExecutionCompletedEvent**: يُرسل عند اكتمال تنفيذ وكيل لمهمة
- **AgentExecutionErrorEvent**: يُرسل عند مواجهة وكيل لخطأ أثناء التنفيذ
- **LiteAgentExecutionStartedEvent**: يُرسل عند بدء تنفيذ LiteAgent
- **LiteAgentExecutionCompletedEvent**: يُرسل عند اكتمال تنفيذ LiteAgent
### أحداث المهام
- **TaskStartedEvent**: يُرسل عند بدء تنفيذ مهمة
- **TaskCompletedEvent**: يُرسل عند اكتمال تنفيذ مهمة
- **TaskFailedEvent**: يُرسل عند فشل تنفيذ مهمة
### أحداث استخدام الأدوات
- **ToolUsageStartedEvent**: يُرسل عند بدء تنفيذ أداة
- **ToolUsageFinishedEvent**: يُرسل عند اكتمال تنفيذ أداة
- **ToolUsageErrorEvent**: يُرسل عند مواجهة خطأ في تنفيذ أداة
### أحداث MCP
- **MCPConnectionStartedEvent**: يُرسل عند بدء الاتصال بخادم MCP
- **MCPConnectionCompletedEvent**: يُرسل عند اكتمال الاتصال بخادم MCP
- **MCPConnectionFailedEvent**: يُرسل عند فشل الاتصال بخادم MCP
- **MCPToolExecutionStartedEvent**: يُرسل عند بدء تنفيذ أداة MCP
- **MCPToolExecutionCompletedEvent**: يُرسل عند اكتمال تنفيذ أداة MCP
- **MCPToolExecutionFailedEvent**: يُرسل عند فشل تنفيذ أداة MCP
### أحداث المعرفة
- **KnowledgeRetrievalStartedEvent**: يُرسل عند بدء استرجاع المعرفة
- **KnowledgeRetrievalCompletedEvent**: يُرسل عند اكتمال استرجاع المعرفة
- **KnowledgeQueryStartedEvent**: يُرسل عند بدء استعلام المعرفة
- **KnowledgeQueryCompletedEvent**: يُرسل عند اكتمال استعلام المعرفة
- **KnowledgeQueryFailedEvent**: يُرسل عند فشل استعلام المعرفة
### أحداث حواجز LLM
- **LLMGuardrailStartedEvent**: يُرسل عند بدء التحقق من الحاجز
- **LLMGuardrailCompletedEvent**: يُرسل عند اكتمال التحقق من الحاجز
- **LLMGuardrailFailedEvent**: يُرسل عند فشل التحقق من الحاجز
### أحداث التدفق
- **FlowCreatedEvent**: يُرسل عند إنشاء تدفق
- **FlowStartedEvent**: يُرسل عند بدء تنفيذ تدفق
- **FlowFinishedEvent**: يُرسل عند اكتمال تنفيذ تدفق
- **FlowPausedEvent**: يُرسل عند إيقاف تدفق مؤقتًا بانتظار ملاحظات بشرية
### أحداث LLM
- **LLMCallStartedEvent**: يُرسل عند بدء استدعاء LLM
- **LLMCallCompletedEvent**: يُرسل عند اكتمال استدعاء LLM
- **LLMCallFailedEvent**: يُرسل عند فشل استدعاء LLM
- **LLMStreamChunkEvent**: يُرسل لكل جزء مستلم أثناء بث استجابات LLM
### أحداث الذاكرة
- **MemoryQueryStartedEvent**: يُرسل عند بدء استعلام الذاكرة
- **MemoryQueryCompletedEvent**: يُرسل عند اكتمال استعلام الذاكرة
- **MemorySaveStartedEvent**: يُرسل عند بدء حفظ الذاكرة
- **MemorySaveCompletedEvent**: يُرسل عند اكتمال حفظ الذاكرة
### أحداث الاستدلال
- **AgentReasoningStartedEvent**: يُرسل عند بدء وكيل الاستدلال حول مهمة
- **AgentReasoningCompletedEvent**: يُرسل عند انتهاء عملية الاستدلال
- **AgentReasoningFailedEvent**: يُرسل عند فشل عملية الاستدلال
### أحداث A2A (وكيل إلى وكيل)
- **A2ADelegationStartedEvent**: يُرسل عند بدء تفويض A2A
- **A2ADelegationCompletedEvent**: يُرسل عند اكتمال تفويض A2A
- **A2AConversationStartedEvent**: يُرسل عند بدء محادثة A2A متعددة الأدوار
- **A2AConversationCompletedEvent**: يُرسل عند انتهاء محادثة A2A
## هيكل معالج الأحداث
يستقبل كل معالج حدث معاملين:
1. **source**: الكائن الذي أرسل الحدث
2. **event**: مثيل الحدث، يحتوي على بيانات خاصة بالحدث
هيكل كائن الحدث يعتمد على نوع الحدث، لكن جميع الأحداث ترث من `BaseEvent` وتتضمن:
- **timestamp**: الوقت الذي أُرسل فيه الحدث
- **type**: معرّف نصي لنوع الحدث
## الاستخدام المتقدم: المعالجات المحددة النطاق
لمعالجة الأحداث المؤقتة، يمكنك استخدام مدير سياق `scoped_handlers`:
```python
from crewai.events import crewai_event_bus, CrewKickoffStartedEvent
with crewai_event_bus.scoped_handlers():
@crewai_event_bus.on(CrewKickoffStartedEvent)
def temp_handler(source, event):
print("This handler only exists within this context")
# قم بشيء يرسل أحداثًا
# خارج السياق، يتم إزالة المعالج المؤقت
```
## حالات الاستخدام
يمكن استخدام مستمعي الأحداث لأغراض متنوعة:
1. **التسجيل والمراقبة**: تتبع تنفيذ طاقمك وتسجيل الأحداث المهمة
2. **التحليلات**: جمع بيانات عن أداء وسلوك طاقمك
3. **التصحيح**: إعداد مستمعين مؤقتين لتصحيح مشاكل محددة
4. **التكامل**: ربط CrewAI بأنظمة خارجية مثل منصات المراقبة وقواعد البيانات أو خدمات الإشعارات
5. **السلوك المخصص**: تشغيل إجراءات مخصصة بناءً على أحداث محددة
## أفضل الممارسات
1. **اجعل المعالجات خفيفة**: يجب أن تكون معالجات الأحداث خفيفة وتتجنب العمليات الحاجبة
2. **معالجة الأخطاء**: أدرج معالجة أخطاء مناسبة في معالجات الأحداث لمنع الاستثناءات من التأثير على التنفيذ الرئيسي
3. **التنظيف**: إذا خصص مستمعك موارد، تأكد من تنظيفها بشكل صحيح
4. **الاستماع الانتقائي**: استمع فقط للأحداث التي تحتاج فعلاً لمعالجتها
5. **الاختبار**: اختبر مستمعي الأحداث بمعزل لضمان سلوكهم كما هو متوقع
بالاستفادة من نظام أحداث CrewAI، يمكنك توسيع وظائفه ودمجه بسلاسة مع بنيتك التحتية الحالية.

267
docs/ar/concepts/files.mdx Normal file
View File

@@ -0,0 +1,267 @@
---
title: الملفات
description: تمرير الصور وملفات PDF والصوت والفيديو والنصوص إلى وكلائك للمعالجة متعددة الوسائط.
icon: file-image
---
## نظرة عامة
يدعم CrewAI مدخلات الملفات متعددة الوسائط الأصلية، مما يتيح لك تمرير الصور وملفات PDF والصوت والفيديو والنصوص مباشرة إلى وكلائك. يتم تنسيق الملفات تلقائيًا وفقًا لمتطلبات API لكل مزود LLM.
<Note type="info" title="اعتمادية اختيارية">
يتطلب دعم الملفات حزمة `crewai-files` الاختيارية. ثبّتها بـ:
```bash
uv add 'crewai[file-processing]'
```
</Note>
<Note type="warning" title="وصول مبكر">
واجهة معالجة الملفات حاليًا في مرحلة الوصول المبكر.
</Note>
## أنواع الملفات
يدعم CrewAI خمسة أنواع ملفات محددة بالإضافة إلى فئة `File` العامة التي تكتشف النوع تلقائيًا:
| النوع | الفئة | حالات الاستخدام |
|:-----|:------|:----------|
| **صورة** | `ImageFile` | صور، لقطات شاشة، مخططات، رسوم بيانية |
| **PDF** | `PDFFile` | مستندات، تقارير، أوراق بحثية |
| **صوت** | `AudioFile` | تسجيلات صوتية، بودكاست، اجتماعات |
| **فيديو** | `VideoFile` | تسجيلات شاشة، عروض تقديمية |
| **نص** | `TextFile` | ملفات كود، سجلات، ملفات بيانات |
| **عام** | `File` | اكتشاف تلقائي للنوع من المحتوى |
```python
from crewai_files import File, ImageFile, PDFFile, AudioFile, VideoFile, TextFile
image = ImageFile(source="screenshot.png")
pdf = PDFFile(source="report.pdf")
audio = AudioFile(source="meeting.mp3")
video = VideoFile(source="demo.mp4")
text = TextFile(source="data.csv")
file = File(source="document.pdf")
```
## مصادر الملفات
يقبل معامل `source` أنواع إدخال متعددة ويكتشف تلقائيًا المعالج المناسب:
### من مسار
```python
from crewai_files import ImageFile
image = ImageFile(source="./images/chart.png")
```
### من عنوان URL
```python
from crewai_files import ImageFile
image = ImageFile(source="https://example.com/image.png")
```
### من بايتات
```python
from crewai_files import ImageFile, FileBytes
image_bytes = download_image_from_api()
image = ImageFile(source=FileBytes(data=image_bytes, filename="downloaded.png"))
image = ImageFile(source=image_bytes)
```
## استخدام الملفات
يمكن تمرير الملفات على مستويات متعددة، حيث تأخذ المستويات الأكثر تحديدًا الأولوية.
### مع الأطقم
مرر الملفات عند تشغيل طاقم:
```python
from crewai import Crew
from crewai_files import ImageFile
crew = Crew(agents=[analyst], tasks=[analysis_task])
result = crew.kickoff(
inputs={"topic": "Q4 Sales"},
input_files={
"chart": ImageFile(source="sales_chart.png"),
"report": PDFFile(source="quarterly_report.pdf"),
}
)
```
### مع المهام
أرفق الملفات بمهام محددة:
```python
from crewai import Task
from crewai_files import ImageFile
task = Task(
description="Analyze the sales chart and identify trends in {chart}",
expected_output="A summary of key trends",
input_files={
"chart": ImageFile(source="sales_chart.png"),
}
)
```
### مع التدفقات
مرر الملفات إلى التدفقات، والتي تنتقل تلقائيًا إلى الأطقم:
```python
from crewai.flow.flow import Flow, start
from crewai_files import ImageFile
class AnalysisFlow(Flow):
@start()
def analyze(self):
return self.analysis_crew.kickoff()
flow = AnalysisFlow()
result = flow.kickoff(
input_files={"image": ImageFile(source="data.png")}
)
```
### مع الوكلاء المستقلين
مرر الملفات مباشرة إلى تشغيل الوكيل:
```python
from crewai import Agent
from crewai_files import ImageFile
agent = Agent(
role="Image Analyst",
goal="Analyze images",
backstory="Expert at visual analysis",
llm="gpt-4o",
)
result = agent.kickoff(
messages="What's in this image?",
input_files={"photo": ImageFile(source="photo.jpg")},
)
```
## أولوية الملفات
عند تمرير الملفات على مستويات متعددة، تتجاوز المستويات الأكثر تحديدًا المستويات الأوسع:
```
Flow input_files < Crew input_files < Task input_files
```
على سبيل المثال، إذا عرّف كل من التدفق والمهمة ملفًا باسم `"chart"`، تُستخدم نسخة المهمة.
## دعم المزودين
تدعم المزودات المختلفة أنواع ملفات مختلفة. يقوم CrewAI تلقائيًا بتنسيق الملفات وفقًا لواجهة كل مزود.
| المزود | صورة | PDF | صوت | فيديو | نص |
|:---------|:-----:|:---:|:-----:|:-----:|:----:|
| **OpenAI** (completions API) | ✓ | | | | |
| **OpenAI** (responses API) | ✓ | ✓ | ✓ | | |
| **Anthropic** (claude-3.x) | ✓ | ✓ | | | |
| **Google Gemini** (gemini-1.5, 2.0, 2.5) | ✓ | ✓ | ✓ | ✓ | ✓ |
| **AWS Bedrock** (claude-3) | ✓ | ✓ | | | |
| **Azure OpenAI** (gpt-4o) | ✓ | | ✓ | | |
<Note type="info" title="Gemini لأقصى دعم للملفات">
تدعم نماذج Google Gemini جميع أنواع الملفات بما في ذلك الفيديو (حتى ساعة واحدة، 2 جيجابايت). استخدم Gemini عندما تحتاج لمعالجة محتوى الفيديو.
</Note>
<Note type="warning" title="أنواع الملفات غير المدعومة">
إذا مررت نوع ملف لا يدعمه المزود (مثل الفيديو إلى OpenAI)، ستتلقى خطأ `UnsupportedFileTypeError`. اختر مزودك بناءً على أنواع الملفات التي تحتاج لمعالجتها.
</Note>
## كيف تُرسل الملفات
يختار CrewAI تلقائيًا الطريقة المثلى لإرسال الملفات إلى كل مزود:
| الطريقة | الوصف | متى تُستخدم |
|:-------|:------------|:----------|
| **Inline Base64** | الملف مضمّن مباشرة في الطلب | ملفات صغيرة (< 5 ميجابايت عادة) |
| **File Upload API** | الملف يُرفع بشكل منفصل، يُشار إليه بمعرّف | ملفات كبيرة تتجاوز العتبة |
| **URL Reference** | عنوان URL مباشر يُمرر إلى النموذج | مصدر الملف هو عنوان URL بالفعل |
### طرق الإرسال حسب المزود
| المزود | Inline Base64 | File Upload API | URL References |
|:---------|:-------------:|:---------------:|:--------------:|
| **OpenAI** | ✓ | ✓ (> 5 MB) | ✓ |
| **Anthropic** | ✓ | ✓ (> 5 MB) | ✓ |
| **Google Gemini** | ✓ | ✓ (> 20 MB) | ✓ |
| **AWS Bedrock** | ✓ | | ✓ (S3 URIs) |
| **Azure OpenAI** | ✓ | | ✓ |
<Note type="info" title="تحسين تلقائي">
لا تحتاج لإدارة هذا بنفسك. يستخدم CrewAI تلقائيًا الطريقة الأكثر كفاءة بناءً على حجم الملف وقدرات المزود. المزودات بدون واجهات رفع الملفات تستخدم inline base64 لجميع الملفات.
</Note>
## أوضاع معالجة الملفات
تحكم في كيفية معالجة الملفات عندما تتجاوز حدود المزود:
```python
from crewai_files import ImageFile, PDFFile
image = ImageFile(source="large.png", mode="strict")
image = ImageFile(source="large.png", mode="auto")
image = ImageFile(source="large.png", mode="warn")
pdf = PDFFile(source="large.pdf", mode="chunk")
```
## قيود المزودين
لكل مزود حدود محددة لأحجام الملفات والأبعاد:
### OpenAI
- **الصور**: حد أقصى 20 ميجابايت، حتى 10 صور لكل طلب
- **PDF**: حد أقصى 32 ميجابايت، حتى 100 صفحة
- **الصوت**: حد أقصى 25 ميجابايت، حتى 25 دقيقة
### Anthropic
- **الصور**: حد أقصى 5 ميجابايت، أقصى 8000x8000 بكسل، حتى 100 صورة
- **PDF**: حد أقصى 32 ميجابايت، حتى 100 صفحة
### Google Gemini
- **الصور**: حد أقصى 100 ميجابايت
- **PDF**: حد أقصى 50 ميجابايت
- **الصوت**: حد أقصى 100 ميجابايت، حتى 9.5 ساعة
- **الفيديو**: حد أقصى 2 جيجابايت، حتى ساعة واحدة
### AWS Bedrock
- **الصور**: حد أقصى 4.5 ميجابايت، أقصى 8000x8000 بكسل
- **PDF**: حد أقصى 3.75 ميجابايت، حتى 100 صفحة
## الإشارة إلى الملفات في الأوامر
استخدم اسم مفتاح الملف في أوصاف المهام للإشارة إلى الملفات:
```python
task = Task(
description="""
Analyze the provided materials:
1. Review the chart in {sales_chart}
2. Cross-reference with data in {quarterly_report}
3. Summarize key findings
""",
expected_output="Analysis summary with key insights",
input_files={
"sales_chart": ImageFile(source="chart.png"),
"quarterly_report": PDFFile(source="report.pdf"),
}
)
```

1068
docs/ar/concepts/flows.mdx Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1464
docs/ar/concepts/llms.mdx Normal file

File diff suppressed because it is too large Load Diff

878
docs/ar/concepts/memory.mdx Normal file
View File

@@ -0,0 +1,878 @@
---
title: الذاكرة
description: الاستفادة من نظام الذاكرة الموحد في CrewAI لتعزيز قدرات الوكلاء.
icon: database
mode: "wide"
---
## نظرة عامة
يوفر CrewAI **نظام ذاكرة موحد** -- فئة `Memory` واحدة تستبدل أنواع الذاكرة المنفصلة (قصيرة المدى، طويلة المدى، ذاكرة الكيانات، والخارجية) بواجهة برمجة تطبيقات ذكية واحدة. تستخدم الذاكرة LLM لتحليل المحتوى عند الحفظ (استنتاج النطاق والفئات والأهمية) وتدعم الاسترجاع متعدد العمق مع تسجيل مركب يمزج بين التشابه الدلالي والحداثة والأهمية.
يمكنك استخدام الذاكرة بأربع طرق: **مستقلة** (سكربتات، دفاتر ملاحظات)، **مع فرق Crew**، **مع Agents**، أو **داخل التدفقات**.
## البدء السريع
```python
from crewai import Memory
memory = Memory()
# Store -- the LLM infers scope, categories, and importance
memory.remember("We decided to use PostgreSQL for the user database.")
# Retrieve -- results ranked by composite score (semantic + recency + importance)
matches = memory.recall("What database did we choose?")
for m in matches:
print(f"[{m.score:.2f}] {m.record.content}")
# Tune scoring for a fast-moving project
memory = Memory(recency_weight=0.5, recency_half_life_days=7)
# Forget
memory.forget(scope="/project/old")
# Explore the self-organized scope tree
print(memory.tree())
print(memory.info("/"))
```
## أربع طرق لاستخدام الذاكرة
### مستقلة
استخدم الذاكرة في السكربتات ودفاتر الملاحظات وأدوات سطر الأوامر أو كقاعدة معرفة مستقلة -- لا حاجة لوكلاء أو فرق Crew.
```python
from crewai import Memory
memory = Memory()
# Build up knowledge
memory.remember("The API rate limit is 1000 requests per minute.")
memory.remember("Our staging environment uses port 8080.")
memory.remember("The team agreed to use feature flags for all new releases.")
# Later, recall what you need
matches = memory.recall("What are our API limits?", limit=5)
for m in matches:
print(f"[{m.score:.2f}] {m.record.content}")
# Extract atomic facts from a longer text
raw = """Meeting notes: We decided to migrate from MySQL to PostgreSQL
next quarter. The budget is $50k. Sarah will lead the migration."""
facts = memory.extract_memories(raw)
# ["Migration from MySQL to PostgreSQL planned for next quarter",
# "Database migration budget is $50k",
# "Sarah will lead the database migration"]
for fact in facts:
memory.remember(fact)
```
### مع فرق Crew
مرّر `memory=True` للإعدادات الافتراضية، أو مرّر مثيل `Memory` مُعدّ للسلوك المخصص.
```python
from crewai import Crew, Agent, Task, Process, Memory
# Option 1: Default memory
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, writing_task],
process=Process.sequential,
memory=True,
verbose=True,
)
# Option 2: Custom memory with tuned scoring
memory = Memory(
recency_weight=0.4,
semantic_weight=0.4,
importance_weight=0.2,
recency_half_life_days=14,
)
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, writing_task],
memory=memory,
)
```
عند استخدام `memory=True`، ينشئ الفريق مثيل `Memory()` افتراضيًا ويمرر إعداد `embedder` الخاص بالفريق تلقائيًا. يشترك جميع الوكلاء في الفريق في ذاكرة الفريق ما لم يكن لدى الوكيل ذاكرته الخاصة.
بعد كل مهمة، يستخرج الفريق تلقائيًا حقائق منفصلة من مخرجات المهمة ويخزّنها. قبل كل مهمة، يسترجع الوكيل السياق ذا الصلة من الذاكرة ويحقنه في موجّه المهمة.
### مع Agents
يمكن للوكلاء استخدام ذاكرة الفريق المشتركة (افتراضيًا) أو تلقي عرض محدد النطاق للسياق الخاص.
```python
from crewai import Agent, Memory
memory = Memory()
# Researcher gets a private scope -- only sees /agent/researcher
researcher = Agent(
role="Researcher",
goal="Find and analyze information",
backstory="Expert researcher with attention to detail",
memory=memory.scope("/agent/researcher"),
)
# Writer uses crew shared memory (no agent-level memory set)
writer = Agent(
role="Writer",
goal="Produce clear, well-structured content",
backstory="Experienced technical writer",
# memory not set -- uses crew._memory when crew has memory enabled
)
```
يمنح هذا النمط الباحث نتائج خاصة بينما يقرأ الكاتب من ذاكرة الفريق المشتركة.
### مع التدفقات
كل تدفق يحتوي على ذاكرة مدمجة. استخدم `self.remember()` و `self.recall()` و `self.extract_memories()` داخل أي دالة تدفق.
```python
from crewai.flow.flow import Flow, listen, start
class ResearchFlow(Flow):
@start()
def gather_data(self):
findings = "PostgreSQL handles 10k concurrent connections. MySQL caps at 5k."
self.remember(findings, scope="/research/databases")
return findings
@listen(gather_data)
def write_report(self, findings):
# Recall past research to provide context
past = self.recall("database performance benchmarks")
context = "\n".join(f"- {m.record.content}" for m in past)
return f"Report:\nNew findings: {findings}\nPrevious context:\n{context}"
```
انظر [وثائق التدفقات](/concepts/flows) لمزيد من المعلومات حول الذاكرة في التدفقات.
## النطاقات الهرمية
### ما هي النطاقات
يتم تنظيم الذكريات في شجرة هرمية من النطاقات، مشابهة لنظام الملفات. كل نطاق هو مسار مثل `/` أو `/project/alpha` أو `/agent/researcher/findings`.
```
/
/company
/company/engineering
/company/product
/project
/project/alpha
/project/beta
/agent
/agent/researcher
/agent/writer
```
توفر النطاقات **ذاكرة تعتمد على السياق** -- عند الاسترجاع ضمن نطاق، تبحث فقط في ذلك الفرع من الشجرة، مما يحسّن كلًا من الدقة والأداء.
### كيف يعمل استنتاج النطاق
عند استدعاء `remember()` دون تحديد نطاق، يحلل LLM المحتوى وشجرة النطاقات الحالية، ثم يقترح أفضل موضع. إذا لم يكن هناك نطاق حالي مناسب، ينشئ واحدًا جديدًا. بمرور الوقت، تنمو شجرة النطاقات عضويًا من المحتوى نفسه -- لا تحتاج إلى تصميم مخطط مسبقًا.
```python
memory = Memory()
# LLM infers scope from content
memory.remember("We chose PostgreSQL for the user database.")
# -> might be placed under /project/decisions or /engineering/database
# You can also specify scope explicitly
memory.remember("Sprint velocity is 42 points", scope="/team/metrics")
```
### تصوير شجرة النطاقات
```python
print(memory.tree())
# / (15 records)
# /project (8 records)
# /project/alpha (5 records)
# /project/beta (3 records)
# /agent (7 records)
# /agent/researcher (4 records)
# /agent/writer (3 records)
print(memory.info("/project/alpha"))
# ScopeInfo(path='/project/alpha', record_count=5,
# categories=['architecture', 'database'],
# oldest_record=datetime(...), newest_record=datetime(...),
# child_scopes=[])
```
### MemoryScope: عروض الأشجار الفرعية
يقيّد `MemoryScope` جميع العمليات على فرع من الشجرة. يمكن للوكيل أو الكود الذي يستخدمه الرؤية والكتابة فقط ضمن تلك الشجرة الفرعية.
```python
memory = Memory()
# Create a scope for a specific agent
agent_memory = memory.scope("/agent/researcher")
# Everything is relative to /agent/researcher
agent_memory.remember("Found three relevant papers on LLM memory.")
# -> stored under /agent/researcher
agent_memory.recall("relevant papers")
# -> searches only under /agent/researcher
# Narrow further with subscope
project_memory = agent_memory.subscope("project-alpha")
# -> /agent/researcher/project-alpha
```
### أفضل الممارسات لتصميم النطاقات
- **ابدأ بشكل مسطح، ودع LLM ينظّم.** لا تبالغ في هندسة تسلسل النطاقات مسبقًا. ابدأ بـ `memory.remember(content)` ودع استنتاج النطاق في LLM ينشئ الهيكل مع تراكم المحتوى.
- **استخدم أنماط `/{entity_type}/{identifier}`.** تنشأ التسلسلات الطبيعية من أنماط مثل `/project/alpha` و `/agent/researcher` و `/company/engineering` و `/customer/acme-corp`.
- **حدد النطاق حسب الاهتمام، وليس حسب نوع البيانات.** استخدم `/project/alpha/decisions` بدلاً من `/decisions/project/alpha`. هذا يبقي المحتوى ذا الصلة معًا.
- **حافظ على العمق ضحلًا (2-3 مستويات).** النطاقات المتداخلة بعمق تصبح متفرقة جدًا. `/project/alpha/architecture` جيد؛ `/project/alpha/architecture/decisions/databases/postgresql` عميق جدًا.
- **استخدم النطاقات الصريحة عندما تعرف، ودع LLM يستنتج عندما لا تعرف.** إذا كنت تخزّن قرار مشروع معروف، مرّر `scope="/project/alpha/decisions"`. إذا كنت تخزّن مخرجات وكيل حرة الشكل، اترك النطاق ودع LLM يحدده.
### أمثلة حالات الاستخدام
**فريق متعدد المشاريع:**
```python
memory = Memory()
# Each project gets its own branch
memory.remember("Using microservices architecture", scope="/project/alpha/architecture")
memory.remember("GraphQL API for client apps", scope="/project/beta/api")
# Recall across all projects
memory.recall("API design decisions")
# Or within a specific project
memory.recall("API design", scope="/project/beta")
```
**سياق خاص لكل وكيل مع معرفة مشتركة:**
```python
memory = Memory()
# Researcher has private findings
researcher_memory = memory.scope("/agent/researcher")
# Writer can read from both its own scope and shared company knowledge
writer_view = memory.slice(
scopes=["/agent/writer", "/company/knowledge"],
read_only=True,
)
```
**دعم العملاء (سياق لكل عميل):**
```python
memory = Memory()
# Each customer gets isolated context
memory.remember("Prefers email communication", scope="/customer/acme-corp")
memory.remember("On enterprise plan, 50 seats", scope="/customer/acme-corp")
# Shared product docs are accessible to all agents
memory.remember("Rate limit is 1000 req/min on enterprise plan", scope="/product/docs")
```
## شرائح الذاكرة
### ما هي الشرائح
`MemorySlice` هو عرض عبر نطاقات متعددة، ربما متباعدة. على عكس النطاق (الذي يقيّد على شجرة فرعية واحدة)، تتيح لك الشريحة الاسترجاع من عدة فروع في وقت واحد.
### متى تستخدم الشرائح مقابل النطاقات
- **النطاق**: استخدمه عندما يجب تقييد وكيل أو كتلة كود على شجرة فرعية واحدة. مثال: وكيل يرى فقط `/agent/researcher`.
- **الشريحة**: استخدمها عندما تحتاج إلى دمج السياق من عدة فروع. مثال: وكيل يقرأ من نطاقه الخاص بالإضافة إلى معرفة الشركة المشتركة.
### شرائح القراءة فقط
النمط الأكثر شيوعًا: منح وكيل إمكانية القراءة من فروع متعددة دون السماح له بالكتابة في المناطق المشتركة.
```python
memory = Memory()
# Agent can recall from its own scope AND company knowledge,
# but cannot write to company knowledge
agent_view = memory.slice(
scopes=["/agent/researcher", "/company/knowledge"],
read_only=True,
)
matches = agent_view.recall("company security policies", limit=5)
# Searches both /agent/researcher and /company/knowledge, merges and ranks results
agent_view.remember("new finding") # Raises PermissionError (read-only)
```
### شرائح القراءة والكتابة
عند تعطيل القراءة فقط، يمكنك الكتابة في أي من النطاقات المضمّنة، لكن يجب تحديد النطاق صراحة.
```python
view = memory.slice(scopes=["/team/alpha", "/team/beta"], read_only=False)
# Must specify scope when writing
view.remember("Cross-team decision", scope="/team/alpha", categories=["decisions"])
```
## التسجيل المركب
يتم ترتيب نتائج الاسترجاع بواسطة مزيج مرجّح من ثلاث إشارات:
```
composite = semantic_weight * similarity + recency_weight * decay + importance_weight * importance
```
حيث:
- **similarity** = `1 / (1 + distance)` من فهرس المتجهات (0 إلى 1)
- **decay** = `0.5^(age_days / half_life_days)` -- اضمحلال أُسي (1.0 لليوم، 0.5 عند نصف العمر)
- **importance** = درجة أهمية السجل (0 إلى 1)، يتم تعيينها وقت الترميز
قم بإعدادها مباشرة على منشئ `Memory`:
```python
# Sprint retrospective: favor recent memories, short half-life
memory = Memory(
recency_weight=0.5,
semantic_weight=0.3,
importance_weight=0.2,
recency_half_life_days=7,
)
# Architecture knowledge base: favor important memories, long half-life
memory = Memory(
recency_weight=0.1,
semantic_weight=0.5,
importance_weight=0.4,
recency_half_life_days=180,
)
```
يتضمن كل `MemoryMatch` قائمة `match_reasons` حتى تتمكن من رؤية سبب ترتيب نتيجة معينة في موضعها (مثل `["semantic", "recency", "importance"]`).
## طبقة تحليل LLM
تستخدم الذاكرة LLM بثلاث طرق:
1. **عند الحفظ** -- عندما تحذف النطاق أو الفئات أو الأهمية، يحلل LLM المحتوى ويقترح النطاق والفئات والأهمية والبيانات الوصفية (الكيانات والتواريخ والموضوعات).
2. **عند الاسترجاع** -- للاسترجاع العميق/التلقائي، يحلل LLM الاستعلام (الكلمات المفتاحية، تلميحات الوقت، النطاقات المقترحة، التعقيد) لتوجيه الاسترجاع.
3. **استخراج الذكريات** -- `extract_memories(content)` يقسم النص الخام (مثل مخرجات المهمة) إلى عبارات ذاكرة منفصلة. يستخدم الوكلاء هذا قبل استدعاء `remember()` على كل عبارة حتى يتم تخزين حقائق ذرية بدلاً من كتلة كبيرة واحدة.
جميع التحليلات تتدهور بسلاسة عند فشل LLM -- انظر [سلوك الفشل](#سلوك-الفشل).
## توحيد الذاكرة
عند حفظ محتوى جديد، يتحقق خط أنابيب الترميز تلقائيًا من وجود سجلات مماثلة في التخزين. إذا كان التشابه أعلى من `consolidation_threshold` (الافتراضي 0.85)، يقرر LLM ما يجب فعله:
- **keep** -- السجل الحالي لا يزال دقيقًا وغير مكرر.
- **update** -- يجب تحديث السجل الحالي بمعلومات جديدة (يوفر LLM المحتوى المدمج).
- **delete** -- السجل الحالي قديم أو تم استبداله أو تناقضه.
- **insert_new** -- ما إذا كان يجب إدراج المحتوى الجديد أيضًا كسجل منفصل.
هذا يمنع تراكم النسخ المكررة. على سبيل المثال، إذا حفظت "CrewAI ensures reliable operation" ثلاث مرات، يتعرف التوحيد على النسخ المكررة ويحتفظ بسجل واحد فقط.
### إزالة التكرار داخل الدفعة
عند استخدام `remember_many()`، تتم مقارنة العناصر داخل نفس الدفعة مع بعضها البعض قبل الوصول إلى التخزين. إذا كان تشابه جيب التمام >= `batch_dedup_threshold` (الافتراضي 0.98)، يتم إسقاط العنصر الأحدث بصمت. هذا يلتقط النسخ المكررة الدقيقة أو شبه الدقيقة داخل دفعة واحدة دون أي استدعاءات LLM (رياضيات متجهات خالصة).
```python
# Only 2 records are stored (the third is a near-duplicate of the first)
memory.remember_many([
"CrewAI supports complex workflows.",
"Python is a great language.",
"CrewAI supports complex workflows.", # dropped by intra-batch dedup
])
```
## الحفظ غير الحاجب
`remember_many()` **غير حاجب** -- يقدم خط أنابيب الترميز إلى خيط خلفي ويعود فورًا. هذا يعني أن الوكيل يمكنه المتابعة إلى المهمة التالية بينما يتم حفظ الذكريات.
```python
# Returns immediately -- save happens in background
memory.remember_many(["Fact A.", "Fact B.", "Fact C."])
# recall() automatically waits for pending saves before searching
matches = memory.recall("facts") # sees all 3 records
```
### حاجز القراءة
كل استدعاء `recall()` يستدعي تلقائيًا `drain_writes()` قبل البحث، مما يضمن أن الاستعلام يرى دائمًا أحدث السجلات المستمرة. هذا شفاف -- لا تحتاج أبدًا إلى التفكير فيه.
### إيقاف الفريق
عند انتهاء الفريق، يستنزف `kickoff()` جميع عمليات حفظ الذاكرة المعلقة في كتلة `finally` الخاصة به، لذا لا تُفقد أي عمليات حفظ حتى لو اكتمل الفريق بينما عمليات الحفظ الخلفية قيد التنفيذ.
### الاستخدام المستقل
للسكربتات أو دفاتر الملاحظات حيث لا توجد دورة حياة فريق، استدعِ `drain_writes()` أو `close()` صراحة:
```python
memory = Memory()
memory.remember_many(["Fact A.", "Fact B."])
# Option 1: Wait for pending saves
memory.drain_writes()
# Option 2: Drain and shut down the background pool
memory.close()
```
## المصدر والخصوصية
يمكن لكل سجل ذاكرة أن يحمل علامة `source` لتتبع المصدر وعلامة `private` للتحكم في الوصول.
### تتبع المصدر
يحدد معامل `source` من أين جاءت الذاكرة:
```python
# Tag memories with their origin
memory.remember("User prefers dark mode", source="user:alice")
memory.remember("System config updated", source="admin")
memory.remember("Agent found a bug", source="agent:debugger")
# Recall only memories from a specific source
matches = memory.recall("user preferences", source="user:alice")
```
### الذكريات الخاصة
الذكريات الخاصة مرئية فقط للاسترجاع عندما يتطابق `source`:
```python
# Store a private memory
memory.remember("Alice's API key is sk-...", source="user:alice", private=True)
# This recall sees the private memory (source matches)
matches = memory.recall("API key", source="user:alice")
# This recall does NOT see it (different source)
matches = memory.recall("API key", source="user:bob")
# Admin access: see all private records regardless of source
matches = memory.recall("API key", include_private=True)
```
هذا مفيد بشكل خاص في النشرات متعددة المستخدمين أو المؤسسية حيث يجب عزل ذكريات المستخدمين المختلفين.
## RecallFlow (الاسترجاع العميق)
يدعم `recall()` عمقين:
- **`depth="shallow"`** -- بحث متجهي مباشر مع تسجيل مركب. سريع (~200 مللي ثانية)، بدون استدعاءات LLM.
- **`depth="deep"` (افتراضي)** -- يشغل RecallFlow متعدد الخطوات: تحليل الاستعلام، اختيار النطاق، بحث متجهي متوازٍ، توجيه قائم على الثقة، واستكشاف متكرر اختياري عندما تكون الثقة منخفضة.
**تخطي LLM الذكي**: الاستعلامات الأقصر من `query_analysis_threshold` (الافتراضي 200 حرف) تتخطى تحليل LLM للاستعلام بالكامل، حتى في الوضع العميق. الاستعلامات القصيرة مثل "ما قاعدة البيانات التي نستخدمها؟" هي بالفعل عبارات بحث جيدة -- تحليل LLM يضيف قيمة قليلة. هذا يوفر ~1-3 ثوانٍ لكل استرجاع للاستعلامات القصيرة النموذجية. فقط الاستعلامات الأطول (مثل أوصاف المهام الكاملة) تمر عبر تقطير LLM إلى استعلامات فرعية مستهدفة.
```python
# Shallow: pure vector search, no LLM
matches = memory.recall("What did we decide?", limit=10, depth="shallow")
# Deep (default): intelligent retrieval with LLM analysis for long queries
matches = memory.recall(
"Summarize all architecture decisions from this quarter",
limit=10,
depth="deep",
)
```
عتبات الثقة التي تتحكم في موجّه RecallFlow قابلة للإعداد:
```python
memory = Memory(
confidence_threshold_high=0.9, # Only synthesize when very confident
confidence_threshold_low=0.4, # Explore deeper more aggressively
exploration_budget=2, # Allow up to 2 exploration rounds
query_analysis_threshold=200, # Skip LLM for queries shorter than this
)
```
## إعداد المُضمِّن
تحتاج الذاكرة إلى نموذج تضمين لتحويل النص إلى متجهات للبحث الدلالي. يمكنك إعداده بثلاث طرق.
### التمرير إلى Memory مباشرة
```python
from crewai import Memory
# As a config dict
memory = Memory(embedder={"provider": "openai", "config": {"model_name": "text-embedding-3-small"}})
# As a pre-built callable
from crewai.rag.embeddings.factory import build_embedder
embedder = build_embedder({"provider": "ollama", "config": {"model_name": "mxbai-embed-large"}})
memory = Memory(embedder=embedder)
```
### عبر إعداد مُضمِّن Crew
عند استخدام `memory=True`، يتم تمرير إعداد `embedder` الخاص بالفريق:
```python
from crewai import Crew
crew = Crew(
agents=[...],
tasks=[...],
memory=True,
embedder={"provider": "openai", "config": {"model_name": "text-embedding-3-small"}},
)
```
### أمثلة المزودين
<AccordionGroup>
<Accordion title="OpenAI (افتراضي)">
```python
memory = Memory(embedder={
"provider": "openai",
"config": {
"model_name": "text-embedding-3-small",
# "api_key": "sk-...", # or set OPENAI_API_KEY env var
},
})
```
</Accordion>
<Accordion title="Ollama (محلي، خاص)">
```python
memory = Memory(embedder={
"provider": "ollama",
"config": {
"model_name": "mxbai-embed-large",
"url": "http://localhost:11434/api/embeddings",
},
})
```
</Accordion>
<Accordion title="Azure OpenAI">
```python
memory = Memory(embedder={
"provider": "azure",
"config": {
"deployment_id": "your-embedding-deployment",
"api_key": "your-azure-api-key",
"api_base": "https://your-resource.openai.azure.com",
"api_version": "2024-02-01",
},
})
```
</Accordion>
<Accordion title="Google AI">
```python
memory = Memory(embedder={
"provider": "google-generativeai",
"config": {
"model_name": "gemini-embedding-001",
# "api_key": "...", # or set GOOGLE_API_KEY env var
},
})
```
</Accordion>
<Accordion title="Google Vertex AI">
```python
memory = Memory(embedder={
"provider": "google-vertex",
"config": {
"model_name": "gemini-embedding-001",
"project_id": "your-gcp-project-id",
"location": "us-central1",
},
})
```
</Accordion>
<Accordion title="Cohere">
```python
memory = Memory(embedder={
"provider": "cohere",
"config": {
"model_name": "embed-english-v3.0",
# "api_key": "...", # or set COHERE_API_KEY env var
},
})
```
</Accordion>
<Accordion title="VoyageAI">
```python
memory = Memory(embedder={
"provider": "voyageai",
"config": {
"model": "voyage-3",
# "api_key": "...", # or set VOYAGE_API_KEY env var
},
})
```
</Accordion>
<Accordion title="AWS Bedrock">
```python
memory = Memory(embedder={
"provider": "amazon-bedrock",
"config": {
"model_name": "amazon.titan-embed-text-v1",
# Uses default AWS credentials (boto3 session)
},
})
```
</Accordion>
<Accordion title="Hugging Face">
```python
memory = Memory(embedder={
"provider": "huggingface",
"config": {
"model_name": "sentence-transformers/all-MiniLM-L6-v2",
},
})
```
</Accordion>
<Accordion title="Jina">
```python
memory = Memory(embedder={
"provider": "jina",
"config": {
"model_name": "jina-embeddings-v2-base-en",
# "api_key": "...", # or set JINA_API_KEY env var
},
})
```
</Accordion>
<Accordion title="IBM WatsonX">
```python
memory = Memory(embedder={
"provider": "watsonx",
"config": {
"model_id": "ibm/slate-30m-english-rtrvr",
"api_key": "your-watsonx-api-key",
"project_id": "your-project-id",
"url": "https://us-south.ml.cloud.ibm.com",
},
})
```
</Accordion>
<Accordion title="مُضمِّن مخصص">
```python
# Pass any callable that takes a list of strings and returns a list of vectors
def my_embedder(texts: list[str]) -> list[list[float]]:
# Your embedding logic here
return [[0.1, 0.2, ...] for _ in texts]
memory = Memory(embedder=my_embedder)
```
</Accordion>
</AccordionGroup>
### مرجع المزودين
| المزود | المفتاح | النموذج النموذجي | ملاحظات |
| :--- | :--- | :--- | :--- |
| OpenAI | `openai` | `text-embedding-3-small` | افتراضي. عيّن `OPENAI_API_KEY`. |
| Ollama | `ollama` | `mxbai-embed-large` | محلي، لا حاجة لمفتاح API. |
| Azure OpenAI | `azure` | `text-embedding-ada-002` | يتطلب `deployment_id`. |
| Google AI | `google-generativeai` | `gemini-embedding-001` | عيّن `GOOGLE_API_KEY`. |
| Google Vertex | `google-vertex` | `gemini-embedding-001` | يتطلب `project_id`. |
| Cohere | `cohere` | `embed-english-v3.0` | دعم قوي متعدد اللغات. |
| VoyageAI | `voyageai` | `voyage-3` | محسّن للاسترجاع. |
| AWS Bedrock | `amazon-bedrock` | `amazon.titan-embed-text-v1` | يستخدم بيانات اعتماد boto3. |
| Hugging Face | `huggingface` | `all-MiniLM-L6-v2` | sentence-transformers محلي. |
| Jina | `jina` | `jina-embeddings-v2-base-en` | عيّن `JINA_API_KEY`. |
| IBM WatsonX | `watsonx` | `ibm/slate-30m-english-rtrvr` | يتطلب `project_id`. |
| Sentence Transformer | `sentence-transformer` | `all-MiniLM-L6-v2` | محلي، لا حاجة لمفتاح API. |
| مخصص | `custom` | -- | يتطلب `embedding_callable`. |
## إعداد LLM
تستخدم الذاكرة LLM لتحليل الحفظ (استنتاج النطاق والفئات والأهمية)، وقرارات التوحيد، وتحليل استعلام الاسترجاع العميق. يمكنك إعداد النموذج المُستخدم.
```python
from crewai import Memory, LLM
# Default: gpt-4o-mini
memory = Memory()
# Use a different OpenAI model
memory = Memory(llm="gpt-4o")
# Use Anthropic
memory = Memory(llm="anthropic/claude-3-haiku-20240307")
# Use Ollama for fully local/private analysis
memory = Memory(llm="ollama/llama3.2")
# Use Google Gemini
memory = Memory(llm="gemini/gemini-2.0-flash")
# Pass a pre-configured LLM instance with custom settings
llm = LLM(model="gpt-4o", temperature=0)
memory = Memory(llm=llm)
```
يتم تهيئة LLM **بشكل كسول** -- يتم إنشاؤه فقط عند الحاجة لأول مرة. هذا يعني أن `Memory()` لا يفشل أبدًا في وقت الإنشاء، حتى لو لم تكن مفاتيح API مُعيّنة. تظهر الأخطاء فقط عند استدعاء LLM فعليًا (مثلاً عند الحفظ بدون نطاق/فئات صريحة، أو أثناء الاسترجاع العميق).
للتشغيل المحلي/الخاص بالكامل، استخدم نموذجًا محليًا لكل من LLM والمُضمِّن:
```python
memory = Memory(
llm="ollama/llama3.2",
embedder={"provider": "ollama", "config": {"model_name": "mxbai-embed-large"}},
)
```
## واجهة التخزين
- **الافتراضي**: LanceDB، مخزّن تحت `./.crewai/memory` (أو `$CREWAI_STORAGE_DIR/memory` إذا تم تعيين متغير البيئة، أو المسار الذي تمرره كـ `storage="path/to/dir"`).
- **واجهة مخصصة**: نفّذ بروتوكول `StorageBackend` (انظر `crewai.memory.storage.backend`) ومرّر مثيلًا إلى `Memory(storage=your_backend)`.
## الاستكشاف
فحص التسلسل الهرمي للنطاقات والفئات والسجلات:
```python
memory.tree() # Formatted tree of scopes and record counts
memory.tree("/project", max_depth=2) # Subtree view
memory.info("/project") # ScopeInfo: record_count, categories, oldest/newest
memory.list_scopes("/") # Immediate child scopes
memory.list_categories() # Category names and counts
memory.list_records(scope="/project/alpha", limit=20) # Records in a scope, newest first
```
## سلوك الفشل
إذا فشل LLM أثناء التحليل (خطأ شبكة، حد معدل، استجابة غير صالحة)، تتدهور الذاكرة بسلاسة:
- **تحليل الحفظ** -- يتم تسجيل تحذير ولا يزال يتم تخزين الذاكرة مع النطاق الافتراضي `/`، فئات فارغة، وأهمية `0.5`.
- **استخراج الذكريات** -- يتم تخزين المحتوى الكامل كذاكرة واحدة حتى لا يُفقد شيء.
- **تحليل الاستعلام** -- يتراجع الاسترجاع إلى اختيار نطاق بسيط وبحث متجهي حتى تستمر في الحصول على نتائج.
لا يتم رفع أي استثناء لفشل التحليل هذه؛ فقط فشل التخزين أو المُضمِّن سيرفع استثناءً.
## ملاحظة حول الخصوصية
يتم إرسال محتوى الذاكرة إلى LLM المُعدّ للتحليل (النطاق/الفئات/الأهمية عند الحفظ، تحليل الاستعلام والاسترجاع العميق الاختياري). للبيانات الحساسة، استخدم LLM محليًا (مثل Ollama) أو تأكد من أن مزودك يلبي متطلبات الامتثال الخاصة بك.
## أحداث الذاكرة
جميع عمليات الذاكرة تُصدر أحداثًا مع `source_type="unified_memory"`. يمكنك الاستماع للتوقيت والأخطاء والمحتوى.
| الحدث | الوصف | الخصائص الرئيسية |
| :---- | :---------- | :------------- |
| **MemoryQueryStartedEvent** | بداية الاستعلام | `query`, `limit` |
| **MemoryQueryCompletedEvent** | نجاح الاستعلام | `query`, `results`, `query_time_ms` |
| **MemoryQueryFailedEvent** | فشل الاستعلام | `query`, `error` |
| **MemorySaveStartedEvent** | بداية الحفظ | `value`, `metadata` |
| **MemorySaveCompletedEvent** | نجاح الحفظ | `value`, `save_time_ms` |
| **MemorySaveFailedEvent** | فشل الحفظ | `value`, `error` |
| **MemoryRetrievalStartedEvent** | بداية استرجاع الوكيل | `task_id` |
| **MemoryRetrievalCompletedEvent** | اكتمال استرجاع الوكيل | `task_id`, `memory_content`, `retrieval_time_ms` |
مثال: مراقبة وقت الاستعلام:
```python
from crewai.events import BaseEventListener, MemoryQueryCompletedEvent
class MemoryMonitor(BaseEventListener):
def setup_listeners(self, crewai_event_bus):
@crewai_event_bus.on(MemoryQueryCompletedEvent)
def on_done(source, event):
if getattr(event, "source_type", None) == "unified_memory":
print(f"Query '{event.query}' completed in {event.query_time_ms:.0f}ms")
```
## استكشاف المشاكل
**الذاكرة لا تستمر؟**
- تأكد من أن مسار التخزين قابل للكتابة (الافتراضي `./.crewai/memory`). مرّر `storage="./your_path"` لاستخدام مجلد مختلف، أو عيّن متغير البيئة `CREWAI_STORAGE_DIR`.
- عند استخدام فريق، تأكد من تعيين `memory=True` أو `memory=Memory(...)`.
**الاسترجاع بطيء؟**
- استخدم `depth="shallow"` لسياق الوكيل الروتيني. احتفظ بـ `depth="deep"` للاستعلامات المعقدة.
- زد `query_analysis_threshold` لتخطي تحليل LLM لمزيد من الاستعلامات.
**أخطاء تحليل LLM في السجلات؟**
- لا تزال الذاكرة تحفظ/تسترجع بإعدادات افتراضية آمنة. تحقق من مفاتيح API وحدود المعدل وتوفر النموذج إذا كنت تريد تحليل LLM كاملاً.
**أخطاء حفظ خلفية في السجلات؟**
- عمليات حفظ الذاكرة تعمل في خيط خلفي. تُصدر الأخطاء كـ `MemorySaveFailedEvent` لكنها لا تعطل الوكيل. تحقق من السجلات للسبب الجذري (عادة مشاكل اتصال LLM أو المُضمِّن).
**تعارضات الكتابة المتزامنة؟**
- عمليات LanceDB مُتسلسلة بقفل مشترك وتُعاد تلقائيًا عند التعارض. هذا يتعامل مع مثيلات `Memory` المتعددة التي تشير إلى نفس قاعدة البيانات (مثل ذاكرة وكيل + ذاكرة فريق). لا حاجة لإجراء.
**تصفح الذاكرة من الطرفية:**
```bash
crewai memory # Opens the TUI browser
crewai memory --storage-path ./my_memory # Point to a specific directory
```
**إعادة تعيين الذاكرة (مثلاً للاختبارات):**
```python
crew.reset_memories(command_type="memory") # Resets unified memory
# Or on a Memory instance:
memory.reset() # All scopes
memory.reset(scope="/project/old") # Only that subtree
```
## مرجع الإعداد
جميع الإعدادات تُمرر كمعاملات كلمة مفتاحية إلى `Memory(...)`. كل معامل له قيمة افتراضية معقولة.
| المعامل | الافتراضي | الوصف |
| :--- | :--- | :--- |
| `llm` | `"gpt-4o-mini"` | LLM للتحليل (اسم نموذج أو مثيل `BaseLLM`). |
| `storage` | `"lancedb"` | واجهة التخزين (`"lancedb"`، سلسلة مسار، أو مثيل `StorageBackend`). |
| `embedder` | `None` (افتراضي OpenAI) | المُضمِّن (قاموس إعداد، دالة قابلة للاستدعاء، أو `None` لافتراضي OpenAI). |
| `recency_weight` | `0.3` | وزن الحداثة في الدرجة المركبة. |
| `semantic_weight` | `0.5` | وزن التشابه الدلالي في الدرجة المركبة. |
| `importance_weight` | `0.2` | وزن الأهمية في الدرجة المركبة. |
| `recency_half_life_days` | `30` | أيام لتنصيف درجة الحداثة (اضمحلال أُسي). |
| `consolidation_threshold` | `0.85` | التشابه الذي يُشغّل فوقه التوحيد عند الحفظ. عيّن إلى `1.0` للتعطيل. |
| `consolidation_limit` | `5` | أقصى عدد سجلات حالية للمقارنة أثناء التوحيد. |
| `default_importance` | `0.5` | الأهمية المُعيّنة عندما لا تُوفَّر ويتم تخطي تحليل LLM. |
| `batch_dedup_threshold` | `0.98` | تشابه جيب التمام لإسقاط النسخ شبه المكررة داخل دفعة `remember_many()`. |
| `confidence_threshold_high` | `0.8` | ثقة الاسترجاع التي تُعاد فوقها النتائج مباشرة. |
| `confidence_threshold_low` | `0.5` | ثقة الاسترجاع التي يُشغّل تحتها استكشاف أعمق. |
| `complex_query_threshold` | `0.7` | للاستعلامات المعقدة، استكشف أعمق تحت هذه الثقة. |
| `exploration_budget` | `1` | عدد جولات الاستكشاف المدفوعة بـ LLM أثناء الاسترجاع العميق. |
| `query_analysis_threshold` | `200` | الاستعلامات الأقصر من هذا (بالأحرف) تتخطى تحليل LLM أثناء الاسترجاع العميق. |

View File

@@ -0,0 +1,155 @@
---
title: التخطيط
description: تعرّف على كيفية إضافة التخطيط إلى طاقم CrewAI وتحسين أدائه.
icon: ruler-combined
mode: "wide"
---
## نظرة عامة
تتيح لك ميزة التخطيط في CrewAI إضافة قدرة التخطيط إلى طاقمك. عند تفعيلها، قبل كل تكرار للطاقم،
يتم إرسال جميع معلومات الطاقم إلى AgentPlanner الذي يخطط للمهام خطوة بخطوة، ويُضاف هذا المخطط إلى وصف كل مهمة.
### استخدام ميزة التخطيط
البدء بميزة التخطيط سهل جدًا، الخطوة الوحيدة المطلوبة هي إضافة `planning=True` إلى طاقمك:
<CodeGroup>
```python Code
from crewai import Crew, Agent, Task, Process
# تجميع طاقمك مع قدرات التخطيط
my_crew = Crew(
agents=self.agents,
tasks=self.tasks,
process=Process.sequential,
planning=True,
)
```
</CodeGroup>
من هذه النقطة فصاعدًا، سيكون التخطيط مفعّلًا في طاقمك، وسيتم تخطيط المهام قبل كل تكرار.
<Warning>
عند تفعيل التخطيط، سيستخدم CrewAI `gpt-4o-mini` كنموذج LLM افتراضي للتخطيط، مما يتطلب مفتاح API صالحًا من OpenAI. نظرًا لأن وكلاءك قد يستخدمون نماذج LLM مختلفة، فقد يسبب ذلك ارتباكًا إذا لم يكن لديك مفتاح OpenAI API مهيأ أو إذا كنت تواجه سلوكًا غير متوقع متعلقًا باستدعاءات LLM API.
</Warning>
#### LLM التخطيط
يمكنك الآن تحديد نموذج LLM الذي سيُستخدم لتخطيط المهام.
عند تشغيل مثال الحالة الأساسية، سترى شيئًا مشابهًا للمخرجات أدناه، والتي تمثل مخرجات `AgentPlanner`
المسؤول عن إنشاء المنطق التدريجي لإضافته إلى مهام الوكلاء.
<CodeGroup>
```python Code
from crewai import Crew, Agent, Task, Process
# تجميع طاقمك مع قدرات التخطيط ونموذج LLM مخصص
my_crew = Crew(
agents=self.agents,
tasks=self.tasks,
process=Process.sequential,
planning=True,
planning_llm="gpt-4o"
)
# تشغيل الطاقم
my_crew.kickoff()
```
```markdown Result
[2024-07-15 16:49:11][INFO]: Planning the crew execution
**Step-by-Step Plan for Task Execution**
**Task Number 1: Conduct a thorough research about AI LLMs**
**Agent:** AI LLMs Senior Data Researcher
**Agent Goal:** Uncover cutting-edge developments in AI LLMs
**Task Expected Output:** A list with 10 bullet points of the most relevant information about AI LLMs
**Task Tools:** None specified
**Agent Tools:** None specified
**Step-by-Step Plan:**
1. **Define Research Scope:**
- Determine the specific areas of AI LLMs to focus on, such as advancements in architecture, use cases, ethical considerations, and performance metrics.
2. **Identify Reliable Sources:**
- List reputable sources for AI research, including academic journals, industry reports, conferences (e.g., NeurIPS, ACL), AI research labs (e.g., OpenAI, Google AI), and online databases (e.g., IEEE Xplore, arXiv).
3. **Collect Data:**
- Search for the latest papers, articles, and reports published in 2024 and early 2025.
- Use keywords like "Large Language Models 2025", "AI LLM advancements", "AI ethics 2025", etc.
4. **Analyze Findings:**
- Read and summarize the key points from each source.
- Highlight new techniques, models, and applications introduced in the past year.
5. **Organize Information:**
- Categorize the information into relevant topics (e.g., new architectures, ethical implications, real-world applications).
- Ensure each bullet point is concise but informative.
6. **Create the List:**
- Compile the 10 most relevant pieces of information into a bullet point list.
- Review the list to ensure clarity and relevance.
**Expected Output:**
A list with 10 bullet points of the most relevant information about AI LLMs.
---
**Task Number 2: Review the context you got and expand each topic into a full section for a report**
**Agent:** AI LLMs Reporting Analyst
**Agent Goal:** Create detailed reports based on AI LLMs data analysis and research findings
**Task Expected Output:** A fully fledged report with the main topics, each with a full section of information. Formatted as markdown without '```'
**Task Tools:** None specified
**Agent Tools:** None specified
**Step-by-Step Plan:**
1. **Review the Bullet Points:**
- Carefully read through the list of 10 bullet points provided by the AI LLMs Senior Data Researcher.
2. **Outline the Report:**
- Create an outline with each bullet point as a main section heading.
- Plan sub-sections under each main heading to cover different aspects of the topic.
3. **Research Further Details:**
- For each bullet point, conduct additional research if necessary to gather more detailed information.
- Look for case studies, examples, and statistical data to support each section.
4. **Write Detailed Sections:**
- Expand each bullet point into a comprehensive section.
- Ensure each section includes an introduction, detailed explanation, examples, and a conclusion.
- Use markdown formatting for headings, subheadings, lists, and emphasis.
5. **Review and Edit:**
- Proofread the report for clarity, coherence, and correctness.
- Make sure the report flows logically from one section to the next.
- Format the report according to markdown standards.
6. **Finalize the Report:**
- Ensure the report is complete with all sections expanded and detailed.
- Double-check formatting and make any necessary adjustments.
**Expected Output:**
A fully fledged report with the main topics, each with a full section of information. Formatted as markdown without '```'.
```
</CodeGroup>

View File

@@ -0,0 +1,67 @@
---
title: العمليات
description: دليل تفصيلي حول إدارة سير العمل من خلال العمليات في CrewAI، مع تفاصيل التنفيذ المحدّثة.
icon: bars-staggered
mode: "wide"
---
## نظرة عامة
<Tip>
تنسّق العمليات تنفيذ المهام بواسطة الوكلاء، على غرار إدارة المشاريع في الفرق البشرية.
تضمن هذه العمليات توزيع المهام وتنفيذها بكفاءة، وفقًا لاستراتيجية محددة مسبقًا.
</Tip>
## تنفيذات العمليات
- **تسلسلي**: ينفذ المهام بالتتابع، مما يضمن إكمال المهام بتقدم منظم.
- **هرمي**: ينظم المهام في تسلسل إداري هرمي، حيث يتم تفويض المهام وتنفيذها بناءً على سلسلة أوامر منظمة. يجب تحديد نموذج لغة المدير (`manager_llm`) أو وكيل مدير مخصص (`manager_agent`) في الطاقم لتفعيل العملية الهرمية، مما يسهّل إنشاء وإدارة المهام من قبل المدير.
- **العملية التوافقية (مخطط لها)**: تهدف إلى اتخاذ القرارات بشكل تعاوني بين الوكلاء حول تنفيذ المهام، وتقدم هذه العملية نهجًا ديمقراطيًا لإدارة المهام داخل CrewAI. وهي مخطط لها للتطوير المستقبلي وغير مطبقة حاليًا في قاعدة الكود.
## دور العمليات في العمل الجماعي
تُمكّن العمليات الوكلاء الأفراد من العمل كوحدة متماسكة، مما يبسّط جهودهم لتحقيق أهداف مشتركة بكفاءة وتناسق.
## تعيين العمليات للطاقم
لتعيين عملية لطاقم، حدد نوع العملية عند إنشاء الطاقم لتعيين استراتيجية التنفيذ. للعملية الهرمية، تأكد من تحديد `manager_llm` أو `manager_agent` لوكيل المدير.
```python
from crewai import Crew, Process
# مثال: إنشاء طاقم بعملية تسلسلية
crew = Crew(
agents=my_agents,
tasks=my_tasks,
process=Process.sequential
)
# مثال: إنشاء طاقم بعملية هرمية
# تأكد من توفير manager_llm أو manager_agent
crew = Crew(
agents=my_agents,
tasks=my_tasks,
process=Process.hierarchical,
manager_llm="gpt-4o"
# أو
# manager_agent=my_manager_agent
)
```
**ملاحظة:** تأكد من تعريف `my_agents` و `my_tasks` قبل إنشاء كائن `Crew`، وللعملية الهرمية، يُعد `manager_llm` أو `manager_agent` مطلوبًا أيضًا.
## العملية التسلسلية
تعكس هذه الطريقة سير عمل الفريق الديناميكي، وتتقدم عبر المهام بطريقة مدروسة ومنهجية. يتبع تنفيذ المهام الترتيب المحدد مسبقًا في قائمة المهام، حيث يعمل ناتج مهمة واحدة كسياق للمهمة التالية.
لتخصيص سياق المهمة، استخدم معامل `context` في فئة `Task` لتحديد المخرجات التي يجب استخدامها كسياق للمهام اللاحقة.
## العملية الهرمية
تحاكي التسلسل الهرمي المؤسسي، حيث يسمح CrewAI بتحديد وكيل مدير مخصص أو إنشاء واحد تلقائيًا، مما يتطلب تحديد نموذج لغة المدير (`manager_llm`). يشرف هذا الوكيل على تنفيذ المهام، بما في ذلك التخطيط والتفويض والتحقق. لا يتم تعيين المهام مسبقًا؛ يخصص المدير المهام للوكلاء بناءً على قدراتهم، ويراجع المخرجات، ويقيّم اكتمال المهام.
## فئة Process: نظرة عامة مفصلة
تم تنفيذ فئة `Process` كتعداد (`Enum`)، مما يضمن أمان الأنواع ويقيّد قيم العملية على الأنواع المحددة (`sequential`، `hierarchical`). العملية التوافقية مخطط لإدراجها مستقبلاً، مما يؤكد التزامنا بالتطوير والابتكار المستمر.
## الخلاصة
التعاون المنظم الذي تسهّله العمليات داخل CrewAI ضروري لتمكين العمل الجماعي المنهجي بين الوكلاء.
تم تحديث هذه الوثائق لتعكس أحدث الميزات والتحسينات والتكامل المخطط للعملية التوافقية، مما يضمن وصول المستخدمين إلى أحدث المعلومات وأكثرها شمولاً.

View File

@@ -0,0 +1,154 @@
---
title: بنية الإنتاج
description: أفضل الممارسات لبناء تطبيقات ذكاء اصطناعي جاهزة للإنتاج مع CrewAI
icon: server
mode: "wide"
---
# عقلية التدفق أولاً
عند بناء تطبيقات ذكاء اصطناعي إنتاجية مع CrewAI، **نوصي بالبدء بتدفق (Flow)**.
بينما يمكن تشغيل أطقم أو وكلاء فرديين، فإن تغليفهم في تدفق يوفر الهيكل اللازم لتطبيق متين وقابل للتوسع.
## لماذا التدفقات؟
1. **إدارة الحالة**: توفر التدفقات طريقة مدمجة لإدارة الحالة عبر مراحل مختلفة من تطبيقك. هذا ضروري لتمرير البيانات بين الأطقم والحفاظ على السياق ومعالجة مدخلات المستخدم.
2. **التحكم**: تتيح لك التدفقات تحديد مسارات تنفيذ دقيقة، بما في ذلك الحلقات والشرطيات ومنطق التفريع. هذا أساسي لمعالجة الحالات الاستثنائية وضمان سلوك تطبيقك بشكل متوقع.
3. **المراقبة**: توفر التدفقات هيكلًا واضحًا يسهّل تتبع التنفيذ وتصحيح الأخطاء ومراقبة الأداء. نوصي باستخدام [تتبع CrewAI](/ar/observability/tracing) للحصول على رؤى تفصيلية. ما عليك سوى تشغيل `crewai login` لتفعيل ميزات المراقبة المجانية.
## البنية
يبدو تطبيق CrewAI الإنتاجي النموذجي هكذا:
```mermaid
graph TD
Start((Start)) --> Flow[Flow Orchestrator]
Flow --> State{State Management}
State --> Step1[Step 1: Data Gathering]
Step1 --> Crew1[Research Crew]
Crew1 --> State
State --> Step2{Condition Check}
Step2 -- "Valid" --> Step3[Step 3: Execution]
Step3 --> Crew2[Action Crew]
Step2 -- "Invalid" --> End((End))
Crew2 --> End
```
### 1. فئة التدفق
فئة `Flow` هي نقطة الدخول. تحدد مخطط الحالة والطرق التي تنفذ منطقك.
```python
from crewai.flow.flow import Flow, listen, start
from pydantic import BaseModel
class AppState(BaseModel):
user_input: str = ""
research_results: str = ""
final_report: str = ""
class ProductionFlow(Flow[AppState]):
@start()
def gather_input(self):
# ... منطق الحصول على المدخلات ...
pass
@listen(gather_input)
def run_research_crew(self):
# ... تشغيل طاقم ...
pass
```
### 2. إدارة الحالة
استخدم نماذج Pydantic لتعريف حالتك. يضمن هذا أمان الأنواع ويوضح البيانات المتاحة في كل مرحلة.
- **اجعلها بسيطة**: خزّن فقط ما تحتاجه للاستمرار بين المراحل.
- **استخدم بيانات منظمة**: تجنب القواميس غير المنظمة قدر الإمكان.
### 3. الأطقم كوحدات عمل
فوّض المهام المعقدة إلى الأطقم. يجب أن يكون الطاقم مركّزًا على هدف محدد (مثل "البحث في موضوع"، "كتابة مقال مدونة").
- **لا تبالغ في هندسة الأطقم**: اجعلها مركّزة.
- **مرر الحالة بشكل صريح**: مرر البيانات الضرورية من حالة التدفق إلى مدخلات الطاقم.
```python
@listen(gather_input)
def run_research_crew(self):
crew = ResearchCrew()
result = crew.kickoff(inputs={"topic": self.state.user_input})
self.state.research_results = result.raw
```
## عناصر التحكم الأولية
استفد من عناصر التحكم الأولية في CrewAI لإضافة المتانة والتحكم إلى أطقمك.
### 1. حواجز المهام
استخدم [حواجز المهام](/ar/concepts/tasks#task-guardrails) للتحقق من مخرجات المهام قبل قبولها. يضمن هذا أن وكلاءك ينتجون نتائج عالية الجودة.
```python
def validate_content(result: TaskOutput) -> Tuple[bool, Any]:
if len(result.raw) < 100:
return (False, "Content is too short. Please expand.")
return (True, result.raw)
task = Task(
...,
guardrail=validate_content
)
```
### 2. المخرجات المنظمة
استخدم دائمًا المخرجات المنظمة (`output_pydantic` أو `output_json`) عند تمرير البيانات بين المهام أو إلى تطبيقك. يمنع هذا أخطاء التحليل ويضمن أمان الأنواع.
```python
class ResearchResult(BaseModel):
summary: str
sources: List[str]
task = Task(
...,
output_pydantic=ResearchResult
)
```
### 3. خطافات LLM
استخدم [خطافات LLM](/ar/learn/llm-hooks) لفحص أو تعديل الرسائل قبل إرسالها إلى LLM، أو لتنقية الاستجابات.
```python
@before_llm_call
def log_request(context):
print(f"Agent {context.agent.role} is calling the LLM...")
```
## أنماط النشر
عند نشر تدفقك، ضع في اعتبارك ما يلي:
### CrewAI Enterprise
أسهل طريقة لنشر تدفقك هي استخدام CrewAI Enterprise. تتعامل مع البنية التحتية والمصادقة والمراقبة نيابة عنك.
راجع [دليل النشر](/ar/enterprise/guides/deploy-to-amp) للبدء.
```bash
crewai deploy create
```
### التنفيذ غير المتزامن
للمهام طويلة التشغيل، استخدم `kickoff_async` لتجنب حظر واجهتك البرمجية.
### الاستمرارية
استخدم مزيّن `@persist` لحفظ حالة تدفقك في قاعدة بيانات. يتيح لك هذا استئناف التنفيذ إذا تعطلت العملية أو إذا كنت بحاجة لانتظار مدخلات بشرية.
```python
@persist
class ProductionFlow(Flow[AppState]):
# ...
```
## الخلاصة
- **ابدأ بتدفق.**
- **حدد حالة واضحة.**
- **استخدم الأطقم للمهام المعقدة.**
- **انشر مع API واستمرارية.**

View File

@@ -0,0 +1,148 @@
---
title: الاستدلال
description: "تعرّف على كيفية تفعيل واستخدام استدلال الوكيل لتحسين تنفيذ المهام."
icon: brain
mode: "wide"
---
## نظرة عامة
استدلال الوكيل هو ميزة تتيح للوكلاء التأمل في المهمة وإنشاء خطة قبل التنفيذ. يساعد هذا الوكلاء على التعامل مع المهام بشكل أكثر منهجية ويضمن استعدادهم لأداء العمل المطلوب.
## الاستخدام
لتفعيل الاستدلال لوكيل، ما عليك سوى تعيين `reasoning=True` عند إنشاء الوكيل:
```python
from crewai import Agent
agent = Agent(
role="Data Analyst",
goal="Analyze complex datasets and provide insights",
backstory="You are an experienced data analyst with expertise in finding patterns in complex data.",
reasoning=True, # تفعيل الاستدلال
max_reasoning_attempts=3 # اختياري: تعيين حد أقصى لمحاولات الاستدلال
)
```
## كيف يعمل
عند تفعيل الاستدلال، قبل تنفيذ المهمة، سيقوم الوكيل بما يلي:
1. التأمل في المهمة وإنشاء خطة مفصلة
2. تقييم ما إذا كان مستعدًا لتنفيذ المهمة
3. تحسين الخطة حسب الحاجة حتى يصبح مستعدًا أو يصل إلى max_reasoning_attempts
4. حقن خطة الاستدلال في وصف المهمة قبل التنفيذ
تساعد هذه العملية الوكيل على تقسيم المهام المعقدة إلى خطوات يمكن إدارتها وتحديد التحديات المحتملة قبل البدء.
## خيارات التهيئة
<ParamField body="reasoning" type="bool" default="False">
تفعيل أو تعطيل الاستدلال
</ParamField>
<ParamField body="max_reasoning_attempts" type="int" default="None">
الحد الأقصى لعدد المحاولات لتحسين الخطة قبل المتابعة بالتنفيذ. إذا كانت القيمة None (الافتراضي)، سيستمر الوكيل في التحسين حتى يصبح مستعدًا.
</ParamField>
## مثال
إليك مثالًا كاملًا:
```python
from crewai import Agent, Task, Crew
# إنشاء وكيل مع تفعيل الاستدلال
analyst = Agent(
role="Data Analyst",
goal="Analyze data and provide insights",
backstory="You are an expert data analyst.",
reasoning=True,
max_reasoning_attempts=3 # اختياري: تعيين حد لمحاولات الاستدلال
)
# إنشاء مهمة
analysis_task = Task(
description="Analyze the provided sales data and identify key trends.",
expected_output="A report highlighting the top 3 sales trends.",
agent=analyst
)
# إنشاء طاقم وتشغيل المهمة
crew = Crew(agents=[analyst], tasks=[analysis_task])
result = crew.kickoff()
print(result)
```
## معالجة الأخطاء
صُممت عملية الاستدلال لتكون متينة، مع معالجة أخطاء مدمجة. إذا حدث خطأ أثناء الاستدلال، سيتابع الوكيل تنفيذ المهمة بدون خطة الاستدلال. يضمن هذا إمكانية تنفيذ المهام حتى في حالة فشل عملية الاستدلال.
إليك كيفية التعامل مع الأخطاء المحتملة في الكود الخاص بك:
```python
from crewai import Agent, Task
import logging
# إعداد التسجيل لالتقاط أي أخطاء في الاستدلال
logging.basicConfig(level=logging.INFO)
# إنشاء وكيل مع تفعيل الاستدلال
agent = Agent(
role="Data Analyst",
goal="Analyze data and provide insights",
reasoning=True,
max_reasoning_attempts=3
)
# إنشاء مهمة
task = Task(
description="Analyze the provided sales data and identify key trends.",
expected_output="A report highlighting the top 3 sales trends.",
agent=agent
)
# تنفيذ المهمة
# إذا حدث خطأ أثناء الاستدلال، سيتم تسجيله وسيستمر التنفيذ
result = agent.execute_task(task)
```
## مثال على مخرجات الاستدلال
إليك مثالًا على شكل خطة الاستدلال لمهمة تحليل البيانات:
```
Task: Analyze the provided sales data and identify key trends.
Reasoning Plan:
I'll analyze the sales data to identify the top 3 trends.
1. Understanding of the task:
I need to analyze sales data to identify key trends that would be valuable for business decision-making.
2. Key steps I'll take:
- First, I'll examine the data structure to understand what fields are available
- Then I'll perform exploratory data analysis to identify patterns
- Next, I'll analyze sales by time periods to identify temporal trends
- I'll also analyze sales by product categories and customer segments
- Finally, I'll identify the top 3 most significant trends
3. Approach to challenges:
- If the data has missing values, I'll decide whether to fill or filter them
- If the data has outliers, I'll investigate whether they're valid data points or errors
- If trends aren't immediately obvious, I'll apply statistical methods to uncover patterns
4. Use of available tools:
- I'll use data analysis tools to explore and visualize the data
- I'll use statistical tools to identify significant patterns
- I'll use knowledge retrieval to access relevant information about sales analysis
5. Expected outcome:
A concise report highlighting the top 3 sales trends with supporting evidence from the data.
READY: I am ready to execute the task.
```
تساعد خطة الاستدلال هذه الوكيل على تنظيم نهجه تجاه المهمة، والنظر في التحديات المحتملة، وضمان تقديم المخرجات المتوقعة.

114
docs/ar/concepts/skills.mdx Normal file
View File

@@ -0,0 +1,114 @@
---
title: المهارات
description: حزم المهارات المبنية على نظام الملفات التي تحقن السياق في إرشادات الوكيل.
icon: bolt
mode: "wide"
---
## نظرة عامة
المهارات هي مجلدات مستقلة توفر للوكلاء تعليمات ومراجع وموارد خاصة بالمجال. تُعرّف كل مهارة بملف `SKILL.md` يحتوي على بيانات وصفية YAML ومحتوى Markdown.
تستخدم المهارات **الكشف التدريجي** — يتم تحميل البيانات الوصفية أولاً، ثم التعليمات الكاملة فقط عند التفعيل، وكتالوجات الموارد فقط عند الحاجة.
## هيكل المجلد
```
my-skill/
├── SKILL.md # مطلوب — البيانات الوصفية + التعليمات
├── scripts/ # اختياري — سكربتات قابلة للتنفيذ
├── references/ # اختياري — مستندات مرجعية
└── assets/ # اختياري — ملفات ثابتة (إعدادات، بيانات)
```
يجب أن يتطابق اسم المجلد مع حقل `name` في `SKILL.md`.
## تنسيق SKILL.md
```markdown
---
name: my-skill
description: Short description of what this skill does and when to use it.
license: Apache-2.0 # optional
compatibility: crewai>=0.1.0 # optional
metadata: # optional
author: your-name
version: "1.0"
allowed-tools: web-search file-read # optional, space-delimited
---
Instructions for the agent go here. This markdown body is injected
into the agent's prompt when the skill is activated.
```
### حقول البيانات الوصفية
| الحقل | مطلوب | القيود |
| :-------------- | :------- | :----------------------------------------------------------------------- |
| `name` | نعم | 1-64 حرف. أحرف صغيرة أبجدية رقمية وشرطات. بدون شرطات بادئة/لاحقة/متتالية. يجب أن يطابق اسم المجلد. |
| `description` | نعم | 1-1024 حرف. يصف ما تفعله المهارة ومتى تُستخدم. |
| `license` | لا | اسم الترخيص أو مرجع لملف ترخيص مضمّن. |
| `compatibility` | لا | حد أقصى 500 حرف. متطلبات البيئة (منتجات، حزم، شبكة). |
| `metadata` | لا | تعيين مفتاح-قيمة نصي عشوائي. |
| `allowed-tools` | لا | قائمة أدوات معتمدة مسبقًا مفصولة بمسافات. تجريبي. |
## الاستخدام
### المهارات على مستوى الوكيل
مرر مسارات مجلدات المهارات إلى وكيل:
```python
from crewai import Agent
agent = Agent(
role="Researcher",
goal="Find relevant information",
backstory="An expert researcher.",
skills=["./skills"], # يكتشف جميع المهارات في هذا المجلد
)
```
### المهارات على مستوى الطاقم
تُدمج مسارات المهارات في الطاقم مع كل وكيل:
```python
from crewai import Crew
crew = Crew(
agents=[agent],
tasks=[task],
skills=["./skills"],
)
```
### المهارات المحمّلة مسبقًا
يمكنك أيضًا تمرير كائنات `Skill` مباشرة:
```python
from pathlib import Path
from crewai.skills import discover_skills, activate_skill
skills = discover_skills(Path("./skills"))
activated = [activate_skill(s) for s in skills]
agent = Agent(
role="Researcher",
goal="Find relevant information",
backstory="An expert researcher.",
skills=activated,
)
```
## كيف يتم تحميل المهارات
يتم تحميل المهارات تدريجيًا — فقط البيانات المطلوبة في كل مرحلة يتم قراءتها:
| المرحلة | ما يتم تحميله | متى |
| :--------------- | :------------------------------------------------ | :----------------- |
| الاكتشاف | الاسم، الوصف، حقول البيانات الوصفية | `discover_skills()` |
| التفعيل | نص محتوى SKILL.md الكامل | `activate_skill()` |
أثناء التنفيذ العادي للوكيل، يتم اكتشاف المهارات وتفعيلها تلقائيًا. مجلدات `scripts/` و `references/` و `assets/` متاحة في مسار المهارة `path` للوكلاء الذين يحتاجون للإشارة إلى الملفات مباشرة.

1085
docs/ar/concepts/tasks.mdx Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,49 @@
---
title: الاختبار
description: تعرّف على كيفية اختبار طاقم CrewAI وتقييم أدائه.
icon: vial
mode: "wide"
---
## نظرة عامة
يُعد الاختبار جزءًا حيويًا من عملية التطوير، ومن الضروري التأكد من أن طاقمك يعمل كما هو متوقع. مع CrewAI، يمكنك اختبار طاقمك وتقييم أدائه بسهولة باستخدام إمكانيات الاختبار المدمجة.
### استخدام ميزة الاختبار
أضفنا أمر CLI `crewai test` لتسهيل اختبار طاقمك. سيقوم هذا الأمر بتشغيل طاقمك لعدد محدد من التكرارات وتوفير مقاييس أداء مفصلة. المعاملات هي `n_iterations` و `model`، وهي اختيارية وتكون قيمها الافتراضية 2 و `gpt-4o-mini` على التوالي. حاليًا، المزود الوحيد المتاح هو OpenAI.
```bash
crewai test
```
إذا أردت تشغيل المزيد من التكرارات أو استخدام نموذج مختلف، يمكنك تحديد المعاملات هكذا:
```bash
crewai test --n_iterations 5 --model gpt-4o
```
أو باستخدام الصيغة المختصرة:
```bash
crewai test -n 5 -m gpt-4o
```
عند تشغيل أمر `crewai test`، سيتم تنفيذ الطاقم للعدد المحدد من التكرارات، وستُعرض مقاييس الأداء في نهاية التشغيل.
سيظهر جدول الدرجات في النهاية لعرض أداء الطاقم من حيث المقاييس التالية:
<center>**درجات المهام (1-10 الأعلى أفضل)**</center>
| المهام/الطاقم/الوكلاء | التشغيل 1 | التشغيل 2 | المجموع المتوسط | الوكلاء | معلومات إضافية |
|:------------------|:-----:|:-----:|:----------:|:------------------------------:|:---------------------------------|
| المهمة 1 | 9.0 | 9.5 | **9.2** | Professional Insights | |
| | | | | Researcher | |
| المهمة 2 | 9.0 | 10.0 | **9.5** | Company Profile Investigator | |
| المهمة 3 | 9.0 | 9.0 | **9.0** | Automation Insights | |
| | | | | Specialist | |
| المهمة 4 | 9.0 | 9.0 | **9.0** | Final Report Compiler | Automation Insights Specialist |
| الطاقم | 9.00 | 9.38 | **9.2** | | |
| زمن التنفيذ (ثانية) | 126 | 145 | **135** | | |
يوضح المثال أعلاه نتائج الاختبار لتشغيلين للطاقم مع مهمتين، مع الدرجة الإجمالية المتوسطة لكل مهمة والطاقم ككل.

286
docs/ar/concepts/tools.mdx Normal file
View File

@@ -0,0 +1,286 @@
---
title: الأدوات
description: فهم واستخدام الأدوات ضمن إطار عمل CrewAI لتعاون الوكلاء وتنفيذ المهام.
icon: screwdriver-wrench
mode: "wide"
---
## نظرة عامة
تُمكّن أدوات CrewAI الوكلاء بقدرات تتراوح من البحث على الويب وتحليل البيانات إلى التعاون وتفويض المهام بين الزملاء.
توضح هذه الوثائق كيفية إنشاء هذه الأدوات ودمجها والاستفادة منها ضمن إطار عمل CrewAI، بما في ذلك التركيز على أدوات التعاون.
## ما هي الأداة؟
الأداة في CrewAI هي مهارة أو وظيفة يمكن للوكلاء استخدامها لأداء إجراءات مختلفة.
يشمل ذلك أدوات من [مجموعة أدوات CrewAI](https://github.com/joaomdmoura/crewai-tools) و[أدوات LangChain](https://python.langchain.com/docs/integrations/tools)،
مما يُمكّن كل شيء من عمليات البحث البسيطة إلى التفاعلات المعقدة والعمل الجماعي الفعال بين الوكلاء.
<Note type="info" title="تحسين المؤسسات: مستودع الأدوات">
يوفر CrewAI AMP مستودع أدوات شامل مع تكاملات جاهزة لأنظمة الأعمال الشائعة وواجهات API. انشر الوكلاء مع أدوات المؤسسة في دقائق بدلاً من أيام.
يتضمن مستودع أدوات المؤسسة:
- موصلات جاهزة لأنظمة المؤسسة الشائعة
- واجهة إنشاء أدوات مخصصة
- إمكانيات التحكم في الإصدارات والمشاركة
- ميزات الأمان والامتثال
</Note>
## الخصائص الرئيسية للأدوات
- **المنفعة**: مصممة لمهام مثل البحث على الويب وتحليل البيانات وإنشاء المحتوى وتعاون الوكلاء.
- **التكامل**: تعزز قدرات الوكلاء من خلال دمج الأدوات بسلاسة في سير عملهم.
- **القابلية للتخصيص**: توفر المرونة لتطوير أدوات مخصصة أو استخدام الأدوات الموجودة، لتلبية الاحتياجات المحددة للوكلاء.
- **معالجة الأخطاء**: تتضمن آليات معالجة أخطاء قوية لضمان التشغيل السلس.
- **آلية التخزين المؤقت**: تتميز بتخزين مؤقت ذكي لتحسين الأداء وتقليل العمليات المتكررة.
- **الدعم غير المتزامن**: تتعامل مع الأدوات المتزامنة وغير المتزامنة، مما يُمكّن العمليات غير الحاجبة.
## استخدام أدوات CrewAI
لتعزيز قدرات وكلائك بأدوات CrewAI، ابدأ بتثبيت حزمة الأدوات الإضافية:
```bash
pip install 'crewai[tools]'
```
إليك مثالًا يوضح استخدامها:
```python Code
import os
from crewai import Agent, Task, Crew
# استيراد أدوات crewAI
from crewai_tools import (
DirectoryReadTool,
FileReadTool,
SerperDevTool,
WebsiteSearchTool
)
# إعداد مفاتيح API
os.environ["SERPER_API_KEY"] = "Your Key" # serper.dev API key
os.environ["OPENAI_API_KEY"] = "Your Key"
# إنشاء الأدوات
docs_tool = DirectoryReadTool(directory='./blog-posts')
file_tool = FileReadTool()
search_tool = SerperDevTool()
web_rag_tool = WebsiteSearchTool()
# إنشاء الوكلاء
researcher = Agent(
role='Market Research Analyst',
goal='Provide up-to-date market analysis of the AI industry',
backstory='An expert analyst with a keen eye for market trends.',
tools=[search_tool, web_rag_tool],
verbose=True
)
writer = Agent(
role='Content Writer',
goal='Craft engaging blog posts about the AI industry',
backstory='A skilled writer with a passion for technology.',
tools=[docs_tool, file_tool],
verbose=True
)
# تعريف المهام
research = Task(
description='Research the latest trends in the AI industry and provide a summary.',
expected_output='A summary of the top 3 trending developments in the AI industry with a unique perspective on their significance.',
agent=researcher
)
write = Task(
description='Write an engaging blog post about the AI industry, based on the research analyst\'s summary. Draw inspiration from the latest blog posts in the directory.',
expected_output='A 4-paragraph blog post formatted in markdown with engaging, informative, and accessible content, avoiding complex jargon.',
agent=writer,
output_file='blog-posts/new_post.md'
)
# تجميع طاقم مع تفعيل التخطيط
crew = Crew(
agents=[researcher, writer],
tasks=[research, write],
verbose=True,
planning=True,
)
# تنفيذ المهام
crew.kickoff()
```
## أدوات CrewAI المتاحة
- **معالجة الأخطاء**: جميع الأدوات مبنية بقدرات معالجة الأخطاء، مما يسمح للوكلاء بإدارة الاستثناءات بسلاسة ومتابعة مهامهم.
- **آلية التخزين المؤقت**: جميع الأدوات تدعم التخزين المؤقت، مما يُمكّن الوكلاء من إعادة استخدام النتائج المحصلة سابقًا بكفاءة، مما يقلل الحمل على الموارد الخارجية ويسرّع وقت التنفيذ. يمكنك أيضًا تحديد تحكم أدق في آلية التخزين المؤقت باستخدام خاصية `cache_function` على الأداة.
إليك قائمة بالأدوات المتاحة وأوصافها:
| الأداة | الوصف |
| :------------------------------- | :--------------------------------------------------------------------------------------------- |
| **ApifyActorsTool** | أداة تدمج Apify Actors مع سير عملك لمهام استخراج البيانات من الويب والأتمتة. |
| **BrowserbaseLoadTool** | أداة للتفاعل مع المتصفحات واستخراج البيانات منها. |
| **CodeDocsSearchTool** | أداة RAG محسّنة للبحث في وثائق الكود والمستندات التقنية ذات الصلة. |
| **CodeInterpreterTool** | أداة لتفسير كود Python. |
| **ComposioTool** | تُمكّن استخدام أدوات Composio. |
| **CSVSearchTool** | أداة RAG مصممة للبحث في ملفات CSV، مخصصة للتعامل مع البيانات المنظمة. |
| **DALL-E Tool** | أداة لإنشاء الصور باستخدام DALL-E API. |
| **DirectorySearchTool** | أداة RAG للبحث في المجلدات، مفيدة للتنقل في أنظمة الملفات. |
| **DOCXSearchTool** | أداة RAG للبحث في مستندات DOCX، مثالية لمعالجة ملفات Word. |
| **DirectoryReadTool** | تسهّل قراءة ومعالجة هياكل المجلدات ومحتوياتها. |
| **EXASearchTool** | أداة مصممة لإجراء عمليات بحث شاملة عبر مصادر بيانات متنوعة. |
| **FileReadTool** | تُمكّن قراءة واستخراج البيانات من الملفات، مع دعم تنسيقات ملفات متنوعة. |
| **FirecrawlSearchTool** | أداة للبحث في صفحات الويب باستخدام Firecrawl وإرجاع النتائج. |
| **FirecrawlCrawlWebsiteTool** | أداة لزحف صفحات الويب باستخدام Firecrawl. |
| **FirecrawlScrapeWebsiteTool** | أداة لاستخراج محتوى عناوين URL لصفحات الويب باستخدام Firecrawl. |
| **GithubSearchTool** | أداة RAG للبحث في مستودعات GitHub، مفيدة لبحث الكود والوثائق. |
| **SerperDevTool** | أداة متخصصة لأغراض التطوير، مع وظائف محددة قيد التطوير. |
| **TXTSearchTool** | أداة RAG مركّزة على البحث في ملفات النص (.txt)، مناسبة للبيانات غير المنظمة. |
| **JSONSearchTool** | أداة RAG مصممة للبحث في ملفات JSON، تخدم التعامل مع البيانات المنظمة. |
| **LlamaIndexTool** | تُمكّن استخدام أدوات LlamaIndex. |
| **MDXSearchTool** | أداة RAG مخصصة للبحث في ملفات Markdown (MDX)، مفيدة للوثائق. |
| **PDFSearchTool** | أداة RAG للبحث في مستندات PDF، مثالية لمعالجة المستندات الممسوحة ضوئيًا. |
| **PGSearchTool** | أداة RAG محسّنة للبحث في قواعد بيانات PostgreSQL، مناسبة لاستعلامات قواعد البيانات. |
| **Vision Tool** | أداة لإنشاء الصور باستخدام DALL-E API. |
| **RagTool** | أداة RAG للأغراض العامة قادرة على التعامل مع مصادر وأنواع بيانات متنوعة. |
| **ScrapeElementFromWebsiteTool** | تُمكّن استخراج عناصر محددة من المواقع، مفيدة لاستخراج البيانات المستهدف. |
| **ScrapeWebsiteTool** | تسهّل استخراج المواقع بالكامل، مثالية لجمع البيانات الشامل. |
| **WebsiteSearchTool** | أداة RAG للبحث في محتوى المواقع، محسّنة لاستخراج بيانات الويب. |
| **XMLSearchTool** | أداة RAG مصممة للبحث في ملفات XML، مناسبة لتنسيقات البيانات المنظمة. |
| **YoutubeChannelSearchTool** | أداة RAG للبحث في قنوات YouTube، مفيدة لتحليل محتوى الفيديو. |
| **YoutubeVideoSearchTool** | أداة RAG للبحث في مقاطع فيديو YouTube، مثالية لاستخراج بيانات الفيديو. |
## إنشاء أدواتك الخاصة
<Tip>
يمكن للمطورين إنشاء `أدوات مخصصة` مصممة خصيصًا لاحتياجات وكلائهم أو
استخدام الخيارات الجاهزة.
</Tip>
هناك طريقتان رئيسيتان لإنشاء أداة CrewAI:
### الوراثة من `BaseTool`
```python Code
from crewai.tools import BaseTool
from pydantic import BaseModel, Field
class MyToolInput(BaseModel):
"""Input schema for MyCustomTool."""
argument: str = Field(..., description="Description of the argument.")
class MyCustomTool(BaseTool):
name: str = "Name of my tool"
description: str = "What this tool does. It's vital for effective utilization."
args_schema: Type[BaseModel] = MyToolInput
def _run(self, argument: str) -> str:
# منطق أداتك هنا
return "Tool's result"
```
## دعم الأدوات غير المتزامنة
يدعم CrewAI الأدوات غير المتزامنة، مما يتيح لك تنفيذ أدوات تجري عمليات غير حاجبة مثل طلبات الشبكة وعمليات الإدخال/الإخراج على الملفات أو عمليات async أخرى بدون حجب مسار التنفيذ الرئيسي.
### إنشاء أدوات غير متزامنة
يمكنك إنشاء أدوات غير متزامنة بطريقتين:
#### 1. استخدام مزيّن `tool` مع دوال Async
```python Code
from crewai.tools import tool
@tool("fetch_data_async")
async def fetch_data_async(query: str) -> str:
"""Asynchronously fetch data based on the query."""
# محاكاة عملية غير متزامنة
await asyncio.sleep(1)
return f"Data retrieved for {query}"
```
#### 2. تنفيذ طرق Async في فئات الأدوات المخصصة
```python Code
from crewai.tools import BaseTool
class AsyncCustomTool(BaseTool):
name: str = "async_custom_tool"
description: str = "An asynchronous custom tool"
async def _run(self, query: str = "") -> str:
"""Asynchronously run the tool"""
# تنفيذك غير المتزامن هنا
await asyncio.sleep(1)
return f"Processed {query} asynchronously"
```
### استخدام الأدوات غير المتزامنة
تعمل الأدوات غير المتزامنة بسلاسة في كل من سير عمل الطاقم القياسي وسير عمل التدفق:
```python Code
# في طاقم قياسي
agent = Agent(role="researcher", tools=[async_custom_tool])
# في تدفق
class MyFlow(Flow):
@start()
async def begin(self):
crew = Crew(agents=[agent])
result = await crew.kickoff_async()
return result
```
يتعامل إطار عمل CrewAI تلقائيًا مع تنفيذ الأدوات المتزامنة وغير المتزامنة، لذا لا تحتاج للقلق بشأن كيفية استدعائها بشكل مختلف.
### استخدام مزيّن `tool`
```python Code
from crewai.tools import tool
@tool("Name of my tool")
def my_tool(question: str) -> str:
"""Clear description for what this tool is useful for, your agent will need this information to use it."""
# منطق الدالة هنا
return "Result from your custom tool"
```
### آلية التخزين المؤقت المخصصة
<Tip>
يمكن للأدوات اختياريًا تنفيذ `cache_function` لضبط سلوك
التخزين المؤقت. تحدد هذه الدالة متى يتم تخزين النتائج مؤقتًا بناءً على شروط
محددة، مما يوفر تحكمًا دقيقًا في منطق التخزين المؤقت.
</Tip>
```python Code
from crewai.tools import tool
@tool
def multiplication_tool(first_number: int, second_number: int) -> str:
"""Useful for when you need to multiply two numbers together."""
return first_number * second_number
def cache_func(args, result):
# في هذه الحالة، نخزّن النتيجة مؤقتًا فقط إذا كانت من مضاعفات 2
cache = result % 2 == 0
return cache
multiplication_tool.cache_function = cache_func
writer1 = Agent(
role="Writer",
goal="You write lessons of math for kids.",
backstory="You're an expert in writing and you love to teach kids but you know nothing of math.",
tools=[multiplication_tool],
allow_delegation=False,
)
#...
```
## الخلاصة
الأدوات محورية في توسيع قدرات وكلاء CrewAI، مما يمكّنهم من تنفيذ مجموعة واسعة من المهام والتعاون بفعالية.
عند بناء حلول مع CrewAI، استفد من كل من الأدوات المخصصة والموجودة لتمكين وكلائك وتعزيز نظام الذكاء الاصطناعي البيئي. فكّر في استخدام معالجة الأخطاء وآليات التخزين المؤقت ومرونة معاملات الأدوات لتحسين أداء وقدرات وكلائك.

View File

@@ -0,0 +1,197 @@
---
title: التدريب
description: تعرّف على كيفية تدريب وكلاء CrewAI من خلال تقديم ملاحظات مبكرة والحصول على نتائج متسقة.
icon: dumbbell
mode: "wide"
---
## نظرة عامة
تتيح لك ميزة التدريب في CrewAI تدريب وكلاء الذكاء الاصطناعي باستخدام واجهة سطر الأوامر (CLI).
بتشغيل الأمر `crewai train -n <n_iterations>`، يمكنك تحديد عدد التكرارات لعملية التدريب.
أثناء التدريب، يستخدم CrewAI تقنيات لتحسين أداء وكلائك مع التغذية الراجعة البشرية.
يساعد هذا الوكلاء على تحسين فهمهم واتخاذ القرارات وحل المشكلات.
### تدريب طاقمك باستخدام CLI
لاستخدام ميزة التدريب، اتبع الخطوات التالية:
1. افتح الطرفية أو موجه الأوامر.
2. انتقل إلى المجلد حيث يقع مشروع CrewAI.
3. شغّل الأمر التالي:
```shell
crewai train -n <n_iterations> -f <filename.pkl>
```
<Tip>
استبدل `<n_iterations>` بعدد تكرارات التدريب المرغوب و`<filename>` باسم الملف المناسب المنتهي بـ `.pkl`.
</Tip>
<Note>
إذا حذفت `-f`، فإن المخرجات تُحفظ افتراضيًا في `trained_agents_data.pkl` في مجلد العمل الحالي. يمكنك تمرير مسار مطلق للتحكم في مكان كتابة الملف.
</Note>
### تدريب طاقمك برمجيًا
لتدريب طاقمك برمجيًا، استخدم الخطوات التالية:
1. حدد عدد التكرارات للتدريب.
2. حدد معاملات الإدخال لعملية التدريب.
3. نفّذ أمر التدريب داخل كتلة try-except للتعامل مع الأخطاء المحتملة.
```python Code
n_iterations = 2
inputs = {"topic": "CrewAI Training"}
filename = "your_model.pkl"
try:
YourCrewName_Crew().crew().train(
n_iterations=n_iterations,
inputs=inputs,
filename=filename
)
except Exception as e:
raise Exception(f"An error occurred while training the crew: {e}")
```
## كيف تُستخدم بيانات التدريب من قبل الوكلاء
يستخدم CrewAI مخرجات التدريب بطريقتين: أثناء التدريب لدمج ملاحظاتك البشرية، وبعد التدريب لتوجيه الوكلاء باقتراحات موحدة.
### تدفق بيانات التدريب
```mermaid
flowchart TD
A["Start training<br/>CLI: crewai train -n -f<br/>or Python: crew.train(...)"] --> B["Setup training mode<br/>- task.human_input = true<br/>- disable delegation<br/>- init training_data.pkl + trained file"]
subgraph "Iterations"
direction LR
C["Iteration i<br/>initial_output"] --> D["User human_feedback"]
D --> E["improved_output"]
E --> F["Append to training_data.pkl<br/>by agent_id and iteration"]
end
B --> C
F --> G{"More iterations?"}
G -- "Yes" --> C
G -- "No" --> H["Evaluate per agent<br/>aggregate iterations"]
H --> I["Consolidate<br/>suggestions[] + quality + final_summary"]
I --> J["Save by agent role to trained file<br/>(default: trained_agents_data.pkl)"]
J --> K["Normal (non-training) runs"]
K --> L["Auto-load suggestions<br/>from trained_agents_data.pkl"]
L --> M["Append to prompt<br/>for consistent improvements"]
```
### أثناء تشغيلات التدريب
- في كل تكرار، يسجل النظام لكل وكيل:
- `initial_output`: الإجابة الأولى للوكيل
- `human_feedback`: ملاحظاتك المضمّنة عند الطلب
- `improved_output`: إجابة المتابعة للوكيل بعد الملاحظات
- تُخزن هذه البيانات في ملف عمل باسم `training_data.pkl` مفهرس بمعرّف الوكيل الداخلي والتكرار.
- أثناء نشاط التدريب، يُلحق الوكيل تلقائيًا ملاحظاتك البشرية السابقة بأمره لتطبيق تلك التعليمات في المحاولات اللاحقة ضمن جلسة التدريب.
التدريب تفاعلي: تُعيّن المهام `human_input = true`، لذا سيتوقف التشغيل في بيئة غير تفاعلية بانتظار مدخلات المستخدم.
### بعد اكتمال التدريب
- عند انتهاء `train(...)`، يقيّم CrewAI بيانات التدريب المجمعة لكل وكيل وينتج نتيجة موحدة تحتوي على:
- `suggestions`: تعليمات واضحة وقابلة للتنفيذ مستخلصة من ملاحظاتك والفرق بين المخرجات الأولية/المحسنة
- `quality`: درجة من 0-10 تعكس التحسن
- `final_summary`: مجموعة خطوات عمل تفصيلية للمهام المستقبلية
- تُحفظ هذه النتائج الموحدة في اسم الملف الذي تمرره إلى `train(...)` (الافتراضي عبر CLI هو `trained_agents_data.pkl`). تُفهرس الإدخالات بدور الوكيل `role` لتطبيقها عبر الجلسات.
- أثناء التنفيذ العادي (غير التدريب)، يحمّل كل وكيل تلقائيًا `suggestions` الموحدة ويلحقها بأمر المهمة كتعليمات إلزامية. يمنحك هذا تحسينات متسقة بدون تغيير تعريفات الوكلاء.
### ملخص الملفات
- `training_data.pkl` (مؤقت، لكل جلسة):
- الهيكل: `agent_id -> { iteration_number: { initial_output, human_feedback, improved_output } }`
- الغرض: التقاط البيانات الخام والملاحظات البشرية أثناء التدريب
- الموقع: يُحفظ في مجلد العمل الحالي (CWD)
- `trained_agents_data.pkl` (أو اسم ملفك المخصص):
- الهيكل: `agent_role -> { suggestions: string[], quality: number, final_summary: string }`
- الغرض: استمرار التوجيه الموحد للتشغيلات المستقبلية
- الموقع: يُكتب في CWD افتراضيًا؛ استخدم `-f` لتعيين مسار مخصص (بما في ذلك المطلق)
## اعتبارات نماذج اللغة الصغيرة
<Warning>
عند استخدام نماذج لغة أصغر (≤7 مليار معامل) لتقييم بيانات التدريب، كن على علم أنها قد تواجه تحديات في إنتاج مخرجات منظمة واتباع التعليمات المعقدة.
</Warning>
### قيود النماذج الصغيرة في تقييم التدريب
<CardGroup cols={2}>
<Card title="دقة مخرجات JSON" icon="triangle-exclamation">
غالبًا ما تواجه النماذج الأصغر صعوبة في إنتاج استجابات JSON صالحة مطلوبة لتقييمات التدريب المنظمة، مما يؤدي إلى أخطاء تحليل وبيانات غير مكتملة.
</Card>
<Card title="جودة التقييم" icon="chart-line">
قد توفر النماذج تحت 7 مليار معامل تقييمات أقل دقة مع عمق استدلال محدود مقارنة بالنماذج الأكبر.
</Card>
<Card title="اتباع التعليمات" icon="list-check">
قد لا تُتبع معايير تقييم التدريب المعقدة بالكامل أو تُراعى من قبل النماذج الأصغر.
</Card>
<Card title="الاتساق" icon="rotate">
قد تفتقر التقييمات عبر تكرارات تدريب متعددة إلى الاتساق مع النماذج الأصغر.
</Card>
</CardGroup>
### توصيات للتدريب
<Tabs>
<Tab title="أفضل ممارسة">
لجودة تدريب مثالية وتقييمات موثوقة، نوصي بشدة باستخدام نماذج بحد أدنى 7 مليار معامل أو أكبر:
```python
from crewai import Agent, Crew, Task, LLM
# الحد الأدنى الموصى به لتقييم التدريب
llm = LLM(model="mistral/open-mistral-7b")
# خيارات أفضل لتقييم تدريب موثوق
llm = LLM(model="anthropic/claude-3-sonnet-20240229-v1:0")
llm = LLM(model="gpt-4o")
# استخدم هذا LLM مع وكلائك
agent = Agent(
role="Training Evaluator",
goal="Provide accurate training feedback",
llm=llm
)
```
<Tip>
توفر النماذج الأكثر قوة ملاحظات أعلى جودة مع استدلال أفضل، مما يؤدي إلى تكرارات تدريب أكثر فعالية.
</Tip>
</Tab>
<Tab title="استخدام النماذج الصغيرة">
إذا كان يجب عليك استخدام نماذج أصغر لتقييم التدريب، كن على علم بهذه القيود:
```python
# استخدام نموذج أصغر (توقع بعض القيود)
llm = LLM(model="huggingface/microsoft/Phi-3-mini-4k-instruct")
```
<Warning>
بينما يتضمن CrewAI تحسينات للنماذج الصغيرة، توقع نتائج تقييم أقل موثوقية ودقة قد تتطلب تدخلاً بشريًا أكبر أثناء التدريب.
</Warning>
</Tab>
</Tabs>
### نقاط مهمة يجب ملاحظتها
- **متطلب العدد الصحيح الموجب:** تأكد من أن عدد التكرارات (`n_iterations`) هو عدد صحيح موجب. سيرمي الكود `ValueError` إذا لم يتحقق هذا الشرط.
- **متطلب اسم الملف:** تأكد من أن اسم الملف ينتهي بـ `.pkl`. سيرمي الكود `ValueError` إذا لم يتحقق هذا الشرط.
- **معالجة الأخطاء:** يتعامل الكود مع أخطاء العمليات الفرعية والاستثناءات غير المتوقعة، ويوفر رسائل خطأ للمستخدم.
- يُطبق التوجيه المدرّب في وقت الأمر؛ لا يعدّل تهيئة وكيل Python/YAML.
- يحمّل الوكلاء تلقائيًا الاقتراحات المدربة من ملف باسم `trained_agents_data.pkl` الموجود في مجلد العمل الحالي. إذا درّبت إلى اسم ملف مختلف، أعد تسميته إلى `trained_agents_data.pkl` قبل التشغيل، أو اضبط المحمّل في الكود.
- يمكنك تغيير اسم ملف المخرجات عند استدعاء `crewai train` بـ `-f/--filename`. المسارات المطلقة مدعومة إذا أردت الحفظ خارج CWD.
من المهم ملاحظة أن عملية التدريب قد تستغرق بعض الوقت، اعتمادًا على تعقيد وكلائك وستتطلب أيضًا ملاحظاتك في كل تكرار.
بمجرد اكتمال التدريب، سيكون وكلاؤك مجهزين بقدرات ومعرفة محسّنة، وجاهزين لمعالجة المهام المعقدة وتقديم رؤى أكثر اتساقًا وقيمة.
تذكر تحديث وإعادة تدريب وكلائك بانتظام لضمان بقائهم على اطلاع بأحدث المعلومات والتطورات في المجال.

View File

@@ -0,0 +1,155 @@
---
title: 'مستودعات الوكلاء'
description: 'تعرّف على كيفية استخدام مستودعات الوكلاء لمشاركة وإعادة استخدام وكلائك عبر الفرق والمشاريع'
icon: 'people-group'
mode: "wide"
---
تتيح مستودعات الوكلاء لمستخدمي المؤسسات تخزين ومشاركة وإعادة استخدام تعريفات الوكلاء عبر الفرق والمشاريع. تُمكّن هذه الميزة المؤسسات من الاحتفاظ بمكتبة مركزية من الوكلاء الموحدين، مما يعزز الاتساق ويقلل من ازدواجية الجهود.
<Frame>
![Agent Repositories](/images/enterprise/agent-repositories.png)
</Frame>
## فوائد مستودعات الوكلاء
- **التوحيد**: الحفاظ على تعريفات وكلاء متسقة عبر مؤسستك
- **إعادة الاستخدام**: إنشاء وكيل مرة واحدة واستخدامه في أطقم ومشاريع متعددة
- **الحوكمة**: تطبيق سياسات على مستوى المؤسسة لتهيئات الوكلاء
- **التعاون**: تمكين الفرق من المشاركة والبناء على عمل بعضهم البعض
## إنشاء واستخدام مستودعات الوكلاء
1. يجب أن يكون لديك حساب في CrewAI، جرّب [الخطة المجانية](https://app.crewai.com).
2. أنشئ وكلاء بأدوار وأهداف محددة لسير عملك.
3. هيّئ الأدوات والقدرات لكل مساعد متخصص.
4. انشر الوكلاء عبر المشاريع من خلال الواجهة المرئية أو تكامل API.
<Frame>
![Agent Repositories](/images/enterprise/create-agent-repository.png)
</Frame>
### تحميل الوكلاء من المستودعات
يمكنك تحميل الوكلاء من المستودعات في الكود باستخدام معامل `from_repository` للتشغيل محليًا:
```python
from crewai import Agent
# إنشاء وكيل بتحميله من مستودع
# يتم تحميل الوكيل بجميع إعداداته المحددة مسبقًا
researcher = Agent(
from_repository="market-research-agent"
)
```
### تجاوز إعدادات المستودع
يمكنك تجاوز إعدادات محددة من المستودع بتوفيرها في التهيئة:
```python
researcher = Agent(
from_repository="market-research-agent",
goal="Research the latest trends in AI development", # تجاوز هدف المستودع
verbose=True # إضافة إعداد غير موجود في المستودع
)
```
### مثال: إنشاء طاقم مع وكلاء المستودع
```python
from crewai import Crew, Agent, Task
# تحميل الوكلاء من المستودعات
researcher = Agent(
from_repository="market-research-agent"
)
writer = Agent(
from_repository="content-writer-agent"
)
# إنشاء المهام
research_task = Task(
description="Research the latest trends in AI",
agent=researcher
)
writing_task = Task(
description="Write a comprehensive report based on the research",
agent=writer
)
# إنشاء الطاقم
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, writing_task],
verbose=True
)
# تشغيل الطاقم
result = crew.kickoff()
```
### مثال: استخدام `kickoff()` مع وكلاء المستودع
يمكنك أيضًا استخدام وكلاء المستودع مباشرة مع طريقة `kickoff()` للتفاعلات الأبسط:
```python
from crewai import Agent
from pydantic import BaseModel
from typing import List
# تعريف تنسيق مخرجات منظم
class MarketAnalysis(BaseModel):
key_trends: List[str]
opportunities: List[str]
recommendation: str
# تحميل وكيل من المستودع
analyst = Agent(
from_repository="market-analyst-agent",
verbose=True
)
# الحصول على استجابة حرة
result = analyst.kickoff("Analyze the AI market in 2025")
print(result.raw) # الوصول إلى الاستجابة الخام
# الحصول على مخرجات منظمة
structured_result = analyst.kickoff(
"Provide a structured analysis of the AI market in 2025",
response_format=MarketAnalysis
)
# الوصول إلى البيانات المنظمة
print(f"Key Trends: {structured_result.pydantic.key_trends}")
print(f"Recommendation: {structured_result.pydantic.recommendation}")
```
## أفضل الممارسات
1. **اصطلاح التسمية**: استخدم أسماء واضحة ووصفية لوكلاء المستودع
2. **التوثيق**: أدرج أوصافًا شاملة لكل وكيل
3. **إدارة الأدوات**: تأكد من توفر الأدوات المشار إليها بواسطة وكلاء المستودع في بيئتك
4. **التحكم في الوصول**: أدر الصلاحيات لضمان أن أعضاء الفريق المصرّح لهم فقط يمكنهم تعديل وكلاء المستودع
## إدارة المؤسسة
للتبديل بين المؤسسات أو عرض مؤسستك الحالية، استخدم واجهة سطر أوامر CrewAI:
```bash
# عرض المؤسسة الحالية
crewai org current
# التبديل إلى مؤسسة مختلفة
crewai org switch <org_id>
# عرض جميع المؤسسات المتاحة
crewai org list
```
<Note>
عند تحميل الوكلاء من المستودعات، يجب أن تكون مصادقًا ومتحولًا إلى المؤسسة الصحيحة. إذا تلقيت أخطاء، تحقق من حالة المصادقة وإعدادات المؤسسة باستخدام أوامر CLI أعلاه.
</Note>

View File

@@ -0,0 +1,104 @@
---
title: الأتمتة
description: "إدارة ونشر ومراقبة أطقمك المباشرة (الأتمتة) في مكان واحد."
icon: "rocket"
mode: "wide"
---
## نظرة عامة
الأتمتة هي مركز العمليات المباشرة لأطقمك المنشورة. استخدمها للنشر من GitHub أو ملف ZIP، وإدارة متغيرات البيئة، وإعادة النشر عند الحاجة، ومراقبة حالة كل أتمتة.
<Frame>
![Automations Overview](/images/enterprise/automations-overview.png)
</Frame>
## طرق النشر
### النشر من GitHub
استخدم هذا للمشاريع ذات التحكم في الإصدارات والنشر المستمر.
<Steps>
<Step title="ربط GitHub">
انقر على <b>Configure GitHub</b> وصرّح بالوصول.
</Step>
<Step title="اختيار المستودع والفرع">
اختر <b>المستودع</b> و<b>الفرع</b> الذي تريد النشر منه.
</Step>
<Step title="تفعيل النشر التلقائي (اختياري)">
فعّل <b>النشر التلقائي للالتزامات الجديدة</b> لإرسال التحديثات مع كل دفع.
</Step>
<Step title="إضافة متغيرات البيئة">
أضف المتغيرات السرية فرديًا أو استخدم <b>العرض الجماعي</b> لمتغيرات متعددة.
</Step>
<Step title="النشر">
انقر على <b>Deploy</b> لإنشاء الأتمتة المباشرة.
</Step>
</Steps>
<Frame>
![GitHub Deployment](/images/enterprise/deploy-from-github.png)
</Frame>
### النشر من ZIP
انشر بسرعة بدون Git — ارفع حزمة مضغوطة من مشروعك.
<Steps>
<Step title="اختيار الملف">
اختر أرشيف ZIP من جهازك.
</Step>
<Step title="إضافة متغيرات البيئة">
وفّر أي متغيرات أو مفاتيح مطلوبة.
</Step>
<Step title="النشر">
انقر على <b>Deploy</b> لإنشاء الأتمتة المباشرة.
</Step>
</Steps>
<Frame>
![ZIP Deployment](/images/enterprise/deploy-from-zip.png)
</Frame>
## لوحة تحكم الأتمتة
يعرض الجدول جميع الأتمتة المباشرة مع التفاصيل الرئيسية:
- **CREW**: اسم الأتمتة
- **STATUS**: متصل / فشل / قيد التنفيذ
- **URL**: نقطة نهاية التشغيل/الحالة
- **TOKEN**: رمز الأتمتة
- **ACTIONS**: إعادة النشر، الحذف، والمزيد
استخدم عناصر التحكم في أعلى اليمين للتصفية والبحث:
- البحث بالاسم
- التصفية حسب <b>الحالة</b>
- التصفية حسب <b>المصدر</b> (GitHub / Studio / ZIP)
بعد النشر، يمكنك عرض تفاصيل الأتمتة واستخدام القائمة المنسدلة **الخيارات** لـ `الدردشة مع هذا الطاقم`، `تصدير مكون React` و`التصدير كـ MCP`.
<Frame>
![Automations Table](/images/enterprise/automations-table.png)
</Frame>
## أفضل الممارسات
- فضّل نشر GitHub للتحكم في الإصدارات وCI/CD
- استخدم إعادة النشر للتقدم بعد تحديثات الكود أو التهيئة أو اضبطه على النشر التلقائي مع كل دفع
## ذات صلة
<CardGroup cols={3}>
<Card title="نشر طاقم" href="/ar/enterprise/guides/deploy-to-amp" icon="rocket">
انشر طاقمًا من GitHub أو ملف ZIP.
</Card>
<Card title="مشغلات الأتمتة" href="/ar/enterprise/guides/automation-triggers" icon="trigger">
شغّل الأتمتة عبر webhooks أو API.
</Card>
<Card title="أتمتة Webhook" href="/ar/enterprise/guides/webhook-automation" icon="webhook">
بث الأحداث والتحديثات في الوقت الفعلي إلى أنظمتك.
</Card>
</CardGroup>

View File

@@ -0,0 +1,88 @@
---
title: استوديو الطاقم
description: "إنشاء أتمتة جديدة بمساعدة الذكاء الاصطناعي ومحرر مرئي واختبار متكامل."
icon: "pencil"
mode: "wide"
---
## نظرة عامة
استوديو الطاقم هو مساحة عمل تفاعلية بمساعدة الذكاء الاصطناعي لإنشاء أتمتة جديدة من الصفر باستخدام اللغة الطبيعية ومحرر سير عمل مرئي.
<Frame>
![Crew Studio Overview](/images/enterprise/crew-studio-overview.png)
</Frame>
## الإنشاء المبني على الأوامر النصية
- صِف الأتمتة التي تريدها؛ يقوم الذكاء الاصطناعي بإنشاء الوكلاء والمهام والأدوات.
- استخدم الإدخال الصوتي عبر أيقونة الميكروفون إذا فضّلت ذلك.
- ابدأ من أوامر مدمجة لحالات الاستخدام الشائعة.
<Frame>
![Prompt Builder](/images/enterprise/crew-studio-prompt.png)
</Frame>
## المحرر المرئي
يعكس اللوح سير العمل كعُقد وأسهم مع ثلاث لوحات داعمة تتيح لك تهيئة سير العمل بسهولة بدون كتابة كود؛ ما يُعرف بـ "**البرمجة الحدسية لوكلاء الذكاء الاصطناعي**".
يمكنك استخدام وظيفة السحب والإفلات لإضافة الوكلاء والمهام والأدوات إلى اللوح أو استخدام قسم الدردشة لبناء الوكلاء. يتشارك كلا النهجين الحالة ويمكن استخدامهما بالتبادل.
- **أفكار AI (يسار)**: الاستدلال المتدفق أثناء تصميم سير العمل
- **اللوح (المركز)**: الوكلاء والمهام كعقد متصلة
- **الموارد (يمين)**: مكونات السحب والإفلات (وكلاء، مهام، أدوات)
<Frame>
![Visual Canvas](/images/enterprise/crew-studio-canvas.png)
</Frame>
## التنفيذ والتصحيح
انتقل إلى عرض <b>التنفيذ</b> لتشغيل سير العمل ومراقبته:
- الجدول الزمني للأحداث
- سجلات مفصلة (التفاصيل، الرسائل، البيانات الخام)
- اختبارات محلية قبل النشر
<Frame>
![Execution View](/images/enterprise/crew-studio-execution.png)
</Frame>
## النشر والتصدير
- <b>انشر</b> لنشر أتمتة مباشرة
- <b>حمّل</b> المصدر كملف ZIP للتطوير المحلي أو التخصيص
<Frame>
![Publish & Download](/images/enterprise/crew-studio-publish.png)
</Frame>
بعد النشر، يمكنك عرض تفاصيل الأتمتة واستخدام القائمة المنسدلة **الخيارات** لـ `الدردشة مع هذا الطاقم`، `تصدير مكون React` و`التصدير كـ MCP`.
<Frame>
![Published Automation](/images/enterprise/crew-studio-published.png)
</Frame>
## أفضل الممارسات
- كرر بسرعة في الاستوديو؛ انشر فقط عندما يكون مستقرًا
- اقصر الأدوات على الحد الأدنى من الصلاحيات المطلوبة
- استخدم التتبعات للتحقق من السلوك والأداء
## ذات صلة
<CardGroup cols={4}>
<Card title="تفعيل استوديو الطاقم" href="/ar/enterprise/guides/enable-crew-studio" icon="palette">
تفعيل استوديو الطاقم.
</Card>
<Card title="بناء طاقم" href="/ar/enterprise/guides/build-crew" icon="paintbrush">
بناء طاقم.
</Card>
<Card title="نشر طاقم" href="/ar/enterprise/guides/deploy-to-amp" icon="rocket">
نشر طاقم من GitHub أو ملف ZIP.
</Card>
<Card title="تصدير مكون React" href="/ar/enterprise/guides/react-component-export" icon="download">
تصدير مكون React.
</Card>
</CardGroup>

View File

@@ -0,0 +1,558 @@
---
title: "إدارة HITL للتدفقات"
description: "مراجعة بشرية بمستوى المؤسسات للتدفقات مع إشعارات البريد الإلكتروني أولاً وقواعد التوجيه وإمكانيات الاستجابة التلقائية"
icon: "users-gear"
mode: "wide"
---
<Note>
تتطلب ميزات إدارة Flow HITL مزيّن `@human_feedback`، المتاح في **CrewAI الإصدار 1.8.0 أو أحدث**. تنطبق هذه الميزات تحديدًا على **التدفقات (Flows)**، وليس الأطقم (Crews).
</Note>
يوفر CrewAI Enterprise نظامًا شاملًا لإدارة الإنسان في الحلقة (HITL) للتدفقات يحوّل سير عمل الذكاء الاصطناعي إلى عمليات تعاونية بين الإنسان والذكاء الاصطناعي. تستخدم المنصة **بنية البريد الإلكتروني أولاً** التي تمكّن أي شخص لديه عنوان بريد إلكتروني من الرد على طلبات المراجعة — بدون الحاجة لحساب على المنصة.
## نظرة عامة
<CardGroup cols={3}>
<Card title="تصميم البريد الإلكتروني أولاً" icon="envelope">
يمكن للمستجيبين الرد مباشرة على رسائل الإشعار لتقديم الملاحظات
</Card>
<Card title="توجيه مرن" icon="route">
توجيه الطلبات إلى بريد إلكتروني محدد بناءً على أنماط الطرق أو حالة التدفق
</Card>
<Card title="استجابة تلقائية" icon="clock">
تهيئة استجابات احتياطية تلقائية عندما لا يرد أي شخص في الوقت المحدد
</Card>
</CardGroup>
### الفوائد الرئيسية
- **نموذج ذهني بسيط**: عناوين البريد الإلكتروني عالمية؛ لا حاجة لإدارة مستخدمين أو أدوار المنصة
- **مستجيبون خارجيون**: يمكن لأي شخص لديه بريد إلكتروني الرد، حتى غير مستخدمي المنصة
- **تعيين ديناميكي**: سحب بريد المعيّن مباشرة من حالة التدفق (مثل `sales_rep_email`)
- **تهيئة مخفضة**: إعدادات أقل للتهيئة، وقت أسرع للقيمة
- **البريد الإلكتروني كقناة رئيسية**: يفضل معظم المستخدمين الرد عبر البريد الإلكتروني بدلاً من تسجيل الدخول إلى لوحة التحكم
## إعداد نقاط المراجعة البشرية في التدفقات
هيّئ نقاط تفتيش المراجعة البشرية داخل تدفقاتك باستخدام مزيّن `@human_feedback`. عندما يصل التنفيذ إلى نقطة مراجعة، يتوقف النظام ويُخطر المعيّن عبر البريد الإلكتروني وينتظر الاستجابة.
```python
from crewai.flow.flow import Flow, start, listen, or_
from crewai.flow.human_feedback import human_feedback, HumanFeedbackResult
class ContentApprovalFlow(Flow):
@start()
def generate_content(self):
return "Generated marketing copy for Q1 campaign..."
@human_feedback(
message="Please review this content for brand compliance:",
emit=["approved", "rejected", "needs_revision"],
)
@listen(or_("generate_content", "needs_revision"))
def review_content(self):
return "Marketing copy for review..."
@listen("approved")
def publish_content(self, result: HumanFeedbackResult):
print(f"Publishing approved content. Reviewer notes: {result.feedback}")
@listen("rejected")
def archive_content(self, result: HumanFeedbackResult):
print(f"Content rejected. Reason: {result.feedback}")
```
للحصول على تفاصيل التنفيذ الكاملة، راجع دليل [التغذية الراجعة البشرية في التدفقات](/ar/learn/human-feedback-in-flows).
### معاملات المزيّن
| المعامل | النوع | الوصف |
|-----------|------|-------------|
| `message` | `str` | الرسالة المعروضة للمراجع البشري |
| `emit` | `list[str]` | خيارات الاستجابة الصالحة (تُعرض كأزرار في الواجهة) |
## تهيئة المنصة
الوصول إلى تهيئة HITL من: **النشر** ← **الإعدادات** ← **تهيئة الإنسان في الحلقة**
<Frame>
<img src="/images/enterprise/hitl-settings-overview.png" alt="HITL Configuration Settings" />
</Frame>
### إشعارات البريد الإلكتروني
تبديل لتفعيل أو تعطيل إشعارات البريد الإلكتروني لطلبات HITL.
| الإعداد | الافتراضي | الوصف |
|---------|---------|-------------|
| إشعارات البريد الإلكتروني | مفعّل | إرسال رسائل عند طلب الملاحظات |
<Note>
عند التعطيل، يجب على المستجيبين استخدام واجهة لوحة التحكم أو يجب تهيئة webhooks لأنظمة إشعارات مخصصة.
</Note>
### هدف SLA
تعيين وقت استجابة مستهدف لأغراض التتبع والمقاييس.
| الإعداد | الوصف |
|---------|-------------|
| هدف SLA (دقائق) | وقت الاستجابة المستهدف. يُستخدم لمقاييس لوحة التحكم وتتبع SLA |
اتركه فارغًا لتعطيل تتبع SLA.
## إشعارات واستجابات البريد الإلكتروني
يستخدم نظام HITL بنية البريد الإلكتروني أولاً حيث يمكن للمستجيبين الرد مباشرة على رسائل الإشعار.
### كيف تعمل استجابات البريد الإلكتروني
<Steps>
<Step title="إرسال الإشعار">
عند إنشاء طلب HITL، يُرسل بريد إلكتروني إلى المستجيب المعيّن مع محتوى المراجعة والسياق.
</Step>
<Step title="عنوان الرد">
يتضمن البريد عنوان رد خاص مع رمز موقّع للمصادقة.
</Step>
<Step title="رد المستخدم">
يرد المستجيب ببساطة على البريد بملاحظاته — بدون حاجة لتسجيل الدخول.
</Step>
<Step title="التحقق من الرمز">
تستقبل المنصة الرد، وتتحقق من الرمز الموقّع، وتطابق بريد المرسل.
</Step>
<Step title="استئناف التدفق">
تُسجل الملاحظات ويستمر التدفق مع مدخلات الإنسان.
</Step>
</Steps>
### تنسيق الاستجابة
يمكن للمستجيبين الرد بـ:
- **خيار emit**: إذا تطابق الرد مع خيار `emit` (مثل "approved")، يُستخدم مباشرة
- **نص حر**: أي نص استجابة يُمرر إلى التدفق كملاحظات
- **نص عادي**: يُستخدم السطر الأول من نص الرد كملاحظات
### رسائل التأكيد
بعد معالجة الرد، يستلم المستجيب رسالة تأكيد تشير إلى ما إذا تم إرسال الملاحظات بنجاح أو حدث خطأ.
### أمان رمز البريد
- الرموز موقّعة تشفيريًا للأمان
- تنتهي صلاحية الرموز بعد 7 أيام
- يجب أن يتطابق بريد المرسل مع البريد المصرّح به في الرمز
- تُرسل رسائل تأكيد/خطأ بعد المعالجة
## قواعد التوجيه
توجيه طلبات HITL إلى عناوين بريد إلكتروني محددة بناءً على أنماط الطرق.
<Frame>
<img src="/images/enterprise/hitl-settings-routing-rules.png" alt="HITL Routing Rules Configuration" />
</Frame>
### هيكل القاعدة
```json
{
"name": "Approvals to Finance",
"match": {
"method_name": "approve_*"
},
"assign_to_email": "finance@company.com",
"assign_from_input": "manager_email"
}
```
### أنماط المطابقة
| النمط | الوصف | مثال المطابقة |
|---------|-------------|---------------|
| `approve_*` | حرف بدل (أي أحرف) | `approve_payment`، `approve_vendor` |
| `review_?` | حرف واحد | `review_a`، `review_1` |
| `validate_payment` | مطابقة تامة | `validate_payment` فقط |
### أولوية التعيين
1. **تعيين ديناميكي** (`assign_from_input`): إذا تم تهيئته، يسحب البريد من حالة التدفق
2. **بريد ثابت** (`assign_to_email`): يرجع إلى البريد المهيأ
3. **منشئ النشر**: إذا لم تتطابق أي قاعدة، يُستخدم بريد منشئ النشر
### مثال التعيين الديناميكي
إذا كانت حالة تدفقك تحتوي على `{"sales_rep_email": "alice@company.com"}`، هيّئ:
```json
{
"name": "Route to Sales Rep",
"match": {
"method_name": "review_*"
},
"assign_from_input": "sales_rep_email"
}
```
سيتم تعيين الطلب إلى `alice@company.com` تلقائيًا.
<Tip>
**حالة استخدام**: اسحب المعيّن من CRM أو قاعدة البيانات أو خطوة تدفق سابقة لتوجيه المراجعات ديناميكيًا إلى الشخص المناسب.
</Tip>
## الاستجابة التلقائية
الاستجابة تلقائيًا لطلبات HITL إذا لم يستجب أي شخص خلال المهلة المحددة. يضمن هذا عدم تعليق التدفقات إلى أجل غير مسمى.
### التهيئة
| الإعداد | الوصف |
|---------|-------------|
| مفعّل | تبديل لتفعيل الاستجابة التلقائية |
| المهلة (دقائق) | الوقت المنتظر قبل الاستجابة التلقائية |
| النتيجة الافتراضية | قيمة الاستجابة (يجب أن تطابق خيار `emit`) |
<Frame>
<img src="/images/enterprise/hitl-settings-auto-respond.png" alt="HITL Auto-Response Configuration" />
</Frame>
### حالات الاستخدام
- **الامتثال لـ SLA**: ضمان عدم تعليق التدفقات إلى أجل غير مسمى
- **الموافقة الافتراضية**: الموافقة التلقائية على الطلبات منخفضة المخاطر بعد انتهاء المهلة
- **التراجع السلس**: المتابعة بافتراضي آمن عندما يكون المراجعون غير متاحين
<Warning>
استخدم الاستجابة التلقائية بحذر. فعّلها فقط للمراجعات غير الحرجة حيث تكون الاستجابة الافتراضية مقبولة.
</Warning>
## عملية المراجعة
### واجهة لوحة التحكم
توفر واجهة مراجعة HITL تجربة نظيفة ومركّزة للمراجعين:
- **عرض Markdown**: تنسيق غني لمحتوى المراجعة مع تمييز الصيغة
- **لوحة السياق**: عرض حالة التدفق وتاريخ التنفيذ والمعلومات ذات الصلة
- **إدخال الملاحظات**: تقديم ملاحظات وتعليقات مفصلة مع قرارك
- **إجراءات سريعة**: أزرار خيارات emit بنقرة واحدة مع تعليقات اختيارية
<Frame>
<img src="/images/enterprise/hitl-list-pending-feedbacks.png" alt="HITL Pending Requests List" />
</Frame>
### طرق الاستجابة
يمكن للمراجعين الاستجابة عبر ثلاث قنوات:
| الطريقة | الوصف |
|--------|-------------|
| **الرد عبر البريد** | الرد مباشرة على رسالة الإشعار |
| **لوحة التحكم** | استخدام واجهة لوحة تحكم المؤسسة |
| **API/Webhook** | استجابة برمجية عبر API |
### السجل ومسار التدقيق
يتم تتبع كل تفاعل HITL بجدول زمني كامل:
- سجل القرارات (موافقة/رفض/مراجعة)
- هوية المراجع والطابع الزمني
- الملاحظات والتعليقات المقدمة
- طريقة الاستجابة (بريد/لوحة تحكم/API)
- مقاييس وقت الاستجابة
## التحليلات والمراقبة
تتبع أداء HITL مع تحليلات شاملة.
### لوحة تحكم الأداء
<Frame>
<img src="/images/enterprise/hitl-metrics.png" alt="HITL Metrics Dashboard" />
</Frame>
<CardGroup cols={2}>
<Card title="أوقات الاستجابة" icon="stopwatch">
مراقبة متوسط وميديان أوقات الاستجابة حسب المراجع أو التدفق.
</Card>
<Card title="اتجاهات الحجم" icon="chart-bar">
تحليل أنماط حجم المراجعة لتحسين قدرة الفريق.
</Card>
<Card title="توزيع القرارات" icon="chart-pie">
عرض معدلات الموافقة/الرفض عبر أنواع المراجعة المختلفة.
</Card>
<Card title="تتبع SLA" icon="chart-line">
تتبع نسبة المراجعات المكتملة ضمن أهداف SLA.
</Card>
</CardGroup>
### التدقيق والامتثال
إمكانيات تدقيق جاهزة للمؤسسات للمتطلبات التنظيمية:
- سجل قرارات كامل مع الطوابع الزمنية
- التحقق من هوية المراجع
- سجلات تدقيق غير قابلة للتغيير
- إمكانيات التصدير لتقارير الامتثال
## حالات الاستخدام الشائعة
<AccordionGroup>
<Accordion title="المراجعات الأمنية" icon="shield-halved">
**حالة الاستخدام**: أتمتة استبيانات الأمان الداخلية مع التحقق البشري
- يولّد الذكاء الاصطناعي الردود على الاستبيانات الأمنية
- يراجع فريق الأمن ويتحقق من الدقة عبر البريد الإلكتروني
- يتم تجميع الردود المعتمدة في التقديم النهائي
- مسار تدقيق كامل للامتثال
</Accordion>
<Accordion title="الموافقة على المحتوى" icon="file-lines">
**حالة الاستخدام**: محتوى تسويقي يتطلب مراجعة قانونية/العلامة التجارية
- يولّد الذكاء الاصطناعي نصوص تسويقية أو محتوى وسائل التواصل
- التوجيه إلى بريد فريق العلامة التجارية لمراجعة النبرة/الأسلوب
- النشر التلقائي عند الموافقة
</Accordion>
<Accordion title="الموافقات المالية" icon="money-bill">
**حالة الاستخدام**: تقارير النفقات، شروط العقود، تخصيصات الميزانية
- يعالج الذكاء الاصطناعي مسبقًا ويصنف الطلبات المالية
- التوجيه بناءً على عتبات المبالغ باستخدام التعيين الديناميكي
- الحفاظ على مسار تدقيق كامل للامتثال المالي
</Accordion>
<Accordion title="التعيين الديناميكي من CRM" icon="database">
**حالة الاستخدام**: توجيه المراجعات إلى مالكي الحسابات من CRM
- يجلب التدفق بريد مالك الحساب من CRM
- تخزين البريد في حالة التدفق (مثل `account_owner_email`)
- استخدام `assign_from_input` للتوجيه إلى الشخص المناسب تلقائيًا
</Accordion>
<Accordion title="ضمان الجودة" icon="magnifying-glass">
**حالة الاستخدام**: التحقق من مخرجات الذكاء الاصطناعي قبل التسليم للعميل
- يولّد الذكاء الاصطناعي محتوى أو ردود موجهة للعميل
- يراجع فريق ضمان الجودة عبر إشعار البريد الإلكتروني
- حلقات الملاحظات تحسّن أداء الذكاء الاصطناعي بمرور الوقت
</Accordion>
</AccordionGroup>
## واجهة Webhooks API
عندما تتوقف تدفقاتك للملاحظات البشرية، يمكنك تهيئة webhooks لإرسال بيانات الطلب إلى تطبيقك. يتيح هذا:
- بناء واجهات موافقة مخصصة
- التكامل مع الأدوات الداخلية (Jira، ServiceNow، لوحات تحكم مخصصة)
- توجيه الموافقات إلى أنظمة طرف ثالث
- إشعارات تطبيقات الجوال
- أنظمة القرار المؤتمتة
<Frame>
<img src="/images/enterprise/hitl-settings-webhook.png" alt="HITL Webhook Configuration" />
</Frame>
### تهيئة Webhooks
<Steps>
<Step title="الانتقال إلى الإعدادات">
اذهب إلى **النشر** ← **الإعدادات** ← **الإنسان في الحلقة**
</Step>
<Step title="توسيع قسم Webhooks">
انقر لتوسيع تهيئة **Webhooks**
</Step>
<Step title="إضافة عنوان Webhook">
أدخل عنوان webhook الخاص بك (يجب أن يكون HTTPS في الإنتاج)
</Step>
<Step title="حفظ التهيئة">
انقر على **حفظ التهيئة** للتفعيل
</Step>
</Steps>
يمكنك تهيئة webhooks متعددة. يستقبل كل webhook نشط جميع أحداث HITL.
### أحداث Webhook
ستستقبل نقطة النهاية طلبات HTTP POST لهذه الأحداث:
| نوع الحدث | متى يُطلق |
|------------|----------------|
| `new_request` | يتوقف تدفق ويطلب ملاحظات بشرية |
### حمولة Webhook
تستقبل جميع webhooks حمولة JSON بهذا الهيكل:
```json
{
"event": "new_request",
"request": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"flow_id": "flow_abc123",
"method_name": "review_article",
"message": "Please review this article for publication.",
"emit_options": ["approved", "rejected", "request_changes"],
"state": {
"article_id": 12345,
"author": "john@example.com",
"category": "technology"
},
"metadata": {},
"created_at": "2026-01-14T12:00:00Z"
},
"deployment": {
"id": 456,
"name": "Content Review Flow",
"organization_id": 789
},
"callback_url": "https://api.crewai.com/...",
"assigned_to_email": "reviewer@company.com"
}
```
### الرد على الطلبات
لإرسال الملاحظات، **أرسل POST إلى `callback_url`** المضمّن في حمولة webhook.
```http
POST {callback_url}
Content-Type: application/json
{
"feedback": "Approved. Great article!",
"source": "my_custom_app"
}
```
### الأمان
<Info>
جميع طلبات webhook موقّعة تشفيريًا باستخدام HMAC-SHA256 لضمان الأصالة ومنع التلاعب.
</Info>
#### أمان Webhook
- **توقيعات HMAC-SHA256**: يتضمن كل webhook توقيعًا تشفيريًا
- **أسرار لكل webhook**: لكل webhook سر توقيع فريد
- **مشفرة أثناء التخزين**: أسرار التوقيع مشفرة في قاعدة البيانات
- **التحقق من الطابع الزمني**: يمنع هجمات الإعادة
#### ترويسات التوقيع
يتضمن كل طلب webhook هذه الترويسات:
| الترويسة | الوصف |
|--------|-------------|
| `X-Signature` | توقيع HMAC-SHA256: `sha256=<hex_digest>` |
| `X-Timestamp` | الطابع الزمني Unix عند توقيع الطلب |
#### التحقق
تحقق بحساب:
```python
import hmac
import hashlib
expected = hmac.new(
signing_secret.encode(),
f"{timestamp}.{payload}".encode(),
hashlib.sha256
).hexdigest()
if hmac.compare_digest(expected, signature):
# توقيع صالح
```
### معالجة الأخطاء
يجب أن تعيد نقطة نهاية webhook كود حالة 2xx لتأكيد الاستلام:
| استجابتك | سلوكنا |
|---------------|--------------|
| 2xx | تم تسليم Webhook بنجاح |
| 4xx/5xx | مسجل كفشل، بدون إعادة محاولة |
| مهلة (30 ثانية) | مسجل كفشل، بدون إعادة محاولة |
## الأمان والتحكم في الوصول المبني على الأدوار
### الوصول إلى لوحة التحكم
يُتحكم في وصول HITL على مستوى النشر:
| الصلاحية | القدرة |
|------------|------------|
| `manage_human_feedback` | تهيئة إعدادات HITL، عرض جميع الطلبات |
| `respond_to_human_feedback` | الرد على الطلبات، عرض الطلبات المعيّنة |
### تصريح استجابة البريد الإلكتروني
للردود عبر البريد:
1. يشفّر رمز الرد البريد المصرّح به
2. يجب أن يتطابق بريد المرسل مع بريد الرمز
3. يجب ألا يكون الرمز منتهي الصلاحية (7 أيام افتراضيًا)
4. يجب أن يكون الطلب لا يزال معلقًا
### مسار التدقيق
يتم تسجيل جميع إجراءات HITL:
- إنشاء الطلب
- تغييرات التعيين
- إرسال الاستجابة (مع المصدر: لوحة تحكم/بريد/API)
- حالة استئناف التدفق
## استكشاف الأخطاء وإصلاحها
### عدم إرسال الرسائل
1. تحقق من تفعيل "إشعارات البريد الإلكتروني" في التهيئة
2. تحقق من مطابقة قواعد التوجيه لاسم الطريقة
3. تحقق من صلاحية بريد المعيّن
4. تحقق من احتياطي منشئ النشر إذا لم تتطابق أي قواعد توجيه
### عدم معالجة ردود البريد
1. تحقق من عدم انتهاء صلاحية الرمز (7 أيام افتراضيًا)
2. تحقق من مطابقة بريد المرسل للبريد المعيّن
3. تأكد من أن الطلب لا يزال معلقًا (لم يتم الرد عليه بعد)
### عدم استئناف التدفق
1. تحقق من حالة الطلب في لوحة التحكم
2. تحقق من إمكانية الوصول إلى callback URL
3. تأكد من أن النشر لا يزال قيد التشغيل
## أفضل الممارسات
<Tip>
**ابدأ ببساطة**: ابدأ بإشعارات البريد الإلكتروني لمنشئ النشر، ثم أضف قواعد التوجيه مع نضوج سير عملك.
</Tip>
1. **استخدم التعيين الديناميكي**: اسحب عناوين بريد المعيّنين من حالة التدفق للتوجيه المرن.
2. **هيّئ الاستجابة التلقائية**: أعد استجابة احتياطية للمراجعات غير الحرجة لمنع تعليق التدفقات.
3. **راقب أوقات الاستجابة**: استخدم التحليلات لتحديد الاختناقات وتحسين عملية المراجعة.
4. **اجعل رسائل المراجعة واضحة**: اكتب رسائل واضحة وقابلة للتنفيذ في مزيّن `@human_feedback`.
5. **اختبر تدفق البريد**: أرسل طلبات اختبار للتحقق من تسليم البريد قبل الانتقال للإنتاج.
## الموارد ذات الصلة
<CardGroup cols={2}>
<Card title="التغذية الراجعة البشرية في التدفقات" icon="code" href="/ar/learn/human-feedback-in-flows">
دليل التنفيذ لمزيّن `@human_feedback`
</Card>
<Card title="دليل سير عمل Flow HITL" icon="route" href="/ar/enterprise/guides/human-in-the-loop">
دليل خطوة بخطوة لإعداد سير عمل HITL
</Card>
<Card title="تهيئة RBAC" icon="shield-check" href="/ar/enterprise/features/rbac">
تهيئة التحكم في الوصول المبني على الأدوار لمؤسستك
</Card>
<Card title="بث Webhook" icon="bolt" href="/ar/enterprise/features/webhook-streaming">
إعداد إشعارات الأحداث في الوقت الفعلي
</Card>
</CardGroup>

View File

@@ -0,0 +1,251 @@
---
title: حاجز الهلوسة
description: "منع واكتشاف هلوسات الذكاء الاصطناعي في مهام CrewAI"
icon: "shield-check"
mode: "wide"
---
## نظرة عامة
حاجز الهلوسة هو ميزة مؤسسية تتحقق من المحتوى المولّد بالذكاء الاصطناعي لضمان أنه مبني على الحقائق ولا يحتوي على هلوسات. يحلل مخرجات المهام مقابل سياق مرجعي ويوفر ملاحظات مفصلة عند اكتشاف محتوى محتمل الهلوسة.
## ما هي الهلوسات؟
تحدث هلوسات الذكاء الاصطناعي عندما تولّد نماذج اللغة محتوى يبدو معقولاً لكنه غير صحيح من الناحية الواقعية أو غير مدعوم بالسياق المقدم. يساعد حاجز الهلوسة في منع هذه المشكلات من خلال:
- مقارنة المخرجات مع السياق المرجعي
- تقييم الأمانة للمادة المصدرية
- توفير ملاحظات مفصلة حول المحتوى المشكل
- دعم عتبات مخصصة لصرامة التحقق
## الاستخدام الأساسي
### إعداد الحاجز
```python
from crewai.tasks.hallucination_guardrail import HallucinationGuardrail
from crewai import LLM
# الاستخدام الأساسي - سيستخدم expected_output للمهمة كسياق
guardrail = HallucinationGuardrail(
llm=LLM(model="gpt-4o-mini")
)
# مع سياق مرجعي صريح
context_guardrail = HallucinationGuardrail(
context="AI helps with various tasks including analysis and generation.",
llm=LLM(model="gpt-4o-mini")
)
```
### الإضافة إلى المهام
```python
from crewai import Task
# إنشاء مهمتك مع الحاجز
task = Task(
description="Write a summary about AI capabilities",
expected_output="A factual summary based on the provided context",
agent=my_agent,
guardrail=guardrail # إضافة الحاجز للتحقق من المخرجات
)
```
## التهيئة المتقدمة
### التحقق بعتبة مخصصة
للتحقق الأكثر صرامة، يمكنك تعيين عتبة أمانة مخصصة (مقياس 0-10):
```python
# حاجز صارم يتطلب درجة أمانة عالية
strict_guardrail = HallucinationGuardrail(
context="Quantum computing uses qubits that exist in superposition states.",
llm=LLM(model="gpt-4o-mini"),
threshold=8.0 # يتطلب درجة >= 8 لاجتياز التحقق
)
```
### تضمين سياق استجابة الأدوات
عندما تستخدم مهمتك أدوات، يمكنك تضمين استجابات الأدوات لتحقق أكثر دقة:
```python
# حاجز مع سياق استجابة الأدوات
weather_guardrail = HallucinationGuardrail(
context="Current weather information for the requested location",
llm=LLM(model="gpt-4o-mini"),
tool_response="Weather API returned: Temperature 22°C, Humidity 65%, Clear skies"
)
```
## كيف يعمل
### عملية التحقق
1. **تحليل السياق**: يقارن الحاجز مخرجات المهمة مع السياق المرجعي المقدم
2. **تسجيل الأمانة**: يستخدم مقيّمًا داخليًا لتعيين درجة أمانة (0-10)
3. **تحديد الحكم**: يحدد ما إذا كان المحتوى أمينًا أو يحتوي على هلوسات
4. **التحقق من العتبة**: إذا تم تعيين عتبة مخصصة، يتحقق مقابل تلك الدرجة
5. **توليد الملاحظات**: يوفر أسبابًا مفصلة عند فشل التحقق
### منطق التحقق
- **الوضع الافتراضي**: يستخدم التحقق المبني على الحكم (FAITHFUL مقابل HALLUCINATED)
- **وضع العتبة**: يتطلب أن تلبي درجة الأمانة العتبة المحددة أو تتجاوزها
- **معالجة الأخطاء**: يتعامل بسلاسة مع أخطاء التقييم ويوفر ملاحظات إعلامية
## نتائج الحاجز
يعيد الحاجز نتائج منظمة تشير إلى حالة التحقق:
```python
# مثال على هيكل نتيجة الحاجز
{
"valid": False,
"feedback": "Content appears to be hallucinated (score: 4.2/10, verdict: HALLUCINATED). The output contains information not supported by the provided context."
}
```
### خصائص النتيجة
- **valid**: قيمة منطقية تشير إلى ما إذا اجتازت المخرجات التحقق
- **feedback**: شرح مفصل عند فشل التحقق، يتضمن:
- درجة الأمانة
- تصنيف الحكم
- أسباب محددة للفشل
## التكامل مع نظام المهام
### التحقق التلقائي
عند إضافة حاجز إلى مهمة، يتحقق تلقائيًا من المخرجات قبل اعتبار المهمة مكتملة:
```python
# تدفق التحقق من مخرجات المهمة
task_output = agent.execute_task(task)
validation_result = guardrail(task_output)
if validation_result.valid:
# المهمة تكتمل بنجاح
return task_output
else:
# المهمة تفشل مع ملاحظات التحقق
raise ValidationError(validation_result.feedback)
```
### تتبع الأحداث
يتكامل الحاجز مع نظام أحداث CrewAI لتوفير المراقبة:
- **بدء التحقق**: عند بدء تقييم الحاجز
- **اكتمال التحقق**: عند انتهاء التقييم بالنتائج
- **فشل التحقق**: عند حدوث أخطاء تقنية أثناء التقييم
## أفضل الممارسات
### إرشادات السياق
<Steps>
<Step title="توفير سياق شامل">
أدرج جميع المعلومات الواقعية ذات الصلة التي يجب أن يبني عليها الذكاء الاصطناعي مخرجاته:
```python
context = """
Company XYZ was founded in 2020 and specializes in renewable energy solutions.
They have 150 employees and generated $50M revenue in 2023.
Their main products include solar panels and wind turbines.
"""
```
</Step>
<Step title="الحفاظ على صلة السياق">
أدرج فقط المعلومات المرتبطة مباشرة بالمهمة لتجنب الارتباك:
```python
# جيد: سياق مركّز
context = "The current weather in New York is 18°C with light rain."
# تجنب: معلومات غير ذات صلة
context = "The weather is 18°C. The city has 8 million people. Traffic is heavy."
```
</Step>
<Step title="تحديث السياق بانتظام">
تأكد من أن السياق المرجعي يعكس معلومات حالية ودقيقة.
</Step>
</Steps>
### اختيار العتبة
<Steps>
<Step title="البدء بالتحقق الافتراضي">
ابدأ بدون عتبات مخصصة لفهم الأداء الأساسي.
</Step>
<Step title="الضبط بناءً على المتطلبات">
- **محتوى عالي الأهمية**: استخدم عتبة 8-10 للدقة القصوى
- **محتوى عام**: استخدم عتبة 6-7 للتحقق المتوازن
- **محتوى إبداعي**: استخدم عتبة 4-5 أو التحقق الافتراضي المبني على الحكم
</Step>
<Step title="المراقبة والتكرار">
تتبع نتائج التحقق واضبط العتبات بناءً على الإيجابيات/السلبيات الكاذبة.
</Step>
</Steps>
## اعتبارات الأداء
### التأثير على زمن التنفيذ
- **عبء التحقق**: يضيف كل حاجز حوالي 1-3 ثوانٍ لكل مهمة
- **كفاءة LLM**: اختر نماذج فعالة للتقييم (مثل gpt-4o-mini)
### تحسين التكلفة
- **اختيار النموذج**: استخدم نماذج أصغر وفعالة لتقييم الحاجز
- **حجم السياق**: اجعل السياق المرجعي موجزًا لكن شاملًا
- **التخزين المؤقت**: فكّر في تخزين نتائج التحقق مؤقتًا للمحتوى المتكرر
## استكشاف الأخطاء وإصلاحها
<Accordion title="فشل التحقق دائمًا">
**الأسباب المحتملة:**
- السياق مقيّد جدًا أو غير مرتبط بمخرجات المهمة
- العتبة معينة عالية جدًا لنوع المحتوى
- السياق المرجعي يحتوي على معلومات قديمة
**الحلول:**
- مراجعة وتحديث السياق ليتطابق مع متطلبات المهمة
- خفض العتبة أو استخدام التحقق الافتراضي المبني على الحكم
- التأكد من أن السياق حالي ودقيق
</Accordion>
<Accordion title="إيجابيات كاذبة (محتوى صالح يُعلّم كغير صالح)">
**الأسباب المحتملة:**
- العتبة عالية جدًا للمهام الإبداعية أو التفسيرية
- السياق لا يغطي جميع الجوانب الصالحة للمخرجات
- نموذج التقييم محافظ بشكل مفرط
**الحلول:**
- خفض العتبة أو استخدام التحقق الافتراضي
- توسيع السياق ليشمل محتوى مقبول أوسع
- الاختبار مع نماذج تقييم مختلفة
</Accordion>
<Accordion title="أخطاء التقييم">
**الأسباب المحتملة:**
- مشكلات في الاتصال بالشبكة
- نموذج LLM غير متاح أو محدود المعدل
- مخرجات مهمة أو سياق غير صالح
**الحلول:**
- التحقق من الاتصال بالشبكة وحالة خدمة LLM
- تنفيذ منطق إعادة المحاولة للأعطال المؤقتة
- التحقق من تنسيق مخرجات المهمة قبل تقييم الحاجز
</Accordion>
<Card title="هل تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للمساعدة في تهيئة حاجز الهلوسة أو استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,45 @@
---
title: السوق
description: "اكتشف وثبّت وأدِر الأصول القابلة لإعادة الاستخدام لطواقم مؤسستك."
icon: "store"
mode: "wide"
---
## نظرة عامة
يوفر السوق واجهة منظمة لاكتشاف عمليات التكامل والأدوات الداخلية والأصول القابلة لإعادة الاستخدام التي تسرّع تطوير الطواقم.
<Frame>
![نظرة عامة على السوق](/images/enterprise/marketplace-overview.png)
</Frame>
## قابلية الاكتشاف
- تصفح حسب الفئة والقدرة
- ابحث عن الأصول بالاسم أو الكلمة المفتاحية
## التثبيت والتفعيل
- تثبيت بنقرة واحدة للأصول المعتمدة
- تفعيل أو تعطيل لكل طاقم حسب الحاجة
- تهيئة متغيرات البيئة والنطاقات المطلوبة
<Frame>
![التثبيت والتهيئة](/images/enterprise/marketplace-install.png)
</Frame>
يمكنك أيضاً تنزيل القوالب مباشرة من السوق بالنقر على زر `Download` لاستخدامها محلياً أو تعديلها حسب احتياجاتك.
## ذو صلة
<CardGroup cols={3}>
<Card title="الأدوات والتكاملات" href="/ar/enterprise/features/tools-and-integrations" icon="wrench">
اربط التطبيقات الخارجية وأدِر الأدوات الداخلية التي يمكن لوكلائك استخدامها.
</Card>
<Card title="مستودع الأدوات" href="/ar/enterprise/guides/tool-repository#tool-repository" icon="toolbox">
انشر وثبّت الأدوات لتعزيز قدرات طواقمك.
</Card>
<Card title="مستودع الوكلاء" href="/ar/enterprise/features/agent-repositories" icon="people-group">
خزّن وشارك وأعد استخدام تعريفات الوكلاء عبر الفرق والمشاريع.
</Card>
</CardGroup>

View File

@@ -0,0 +1,342 @@
---
title: إخفاء البيانات الشخصية في التتبعات
description: "إخفاء البيانات الحساسة تلقائياً من تتبعات تنفيذ الطواقم والتدفقات"
icon: "lock"
mode: "wide"
---
## نظرة عامة
إخفاء البيانات الشخصية (PII Redaction) هو ميزة في CrewAI AMP تكتشف تلقائياً وتُقنّع معلومات التعريف الشخصية (PII) في تتبعات تنفيذ الطواقم والتدفقات. يضمن ذلك عدم كشف البيانات الحساسة مثل أرقام بطاقات الائتمان وأرقام الضمان الاجتماعي وعناوين البريد الإلكتروني والأسماء في تتبعات CrewAI AMP. يمكنك أيضاً إنشاء مُعرّفات مخصصة لحماية البيانات الخاصة بمؤسستك.
<Info>
إخفاء البيانات الشخصية متاح في خطة Enterprise.
يجب أن يكون إصدار النشر 1.8.0 أو أعلى.
</Info>
<Frame>
![نظرة عامة على إخفاء البيانات الشخصية](/images/enterprise/pii_mask_recognizer_trace_example.png)
</Frame>
## أهمية إخفاء البيانات الشخصية
عند تشغيل وكلاء الذكاء الاصطناعي في بيئة الإنتاج، غالباً ما تمر معلومات حساسة عبر طواقمك:
- بيانات العملاء من تكاملات CRM
- معلومات مالية من معالجات الدفع
- تفاصيل شخصية من إرسالات النماذج
- بيانات الموظفين الداخلية
بدون إخفاء مناسب، تظهر هذه البيانات في التتبعات، مما يجعل الامتثال للوائح مثل GDPR وHIPAA وPCI-DSS أمراً صعباً. يحل إخفاء البيانات الشخصية هذه المشكلة عن طريق إقناع البيانات الحساسة تلقائياً قبل تخزينها في التتبعات.
## كيف يعمل
1. **الاكتشاف** - مسح بيانات أحداث التتبع بحثاً عن أنماط PII المعروفة
2. **التصنيف** - تحديد نوع البيانات الحساسة (بطاقة ائتمان، SSN، بريد إلكتروني، إلخ.)
3. **الإقناع/الإخفاء** - استبدال البيانات الحساسة بقيم مُقنّعة بناءً على تهيئتك
```
Original: "Contact john.doe@company.com or call 555-123-4567"
Redacted: "Contact <EMAIL_ADDRESS> or call <PHONE_NUMBER>"
```
## تفعيل إخفاء البيانات الشخصية
<Info>
يجب أن تكون على خطة Enterprise وأن يكون إصدار النشر 1.8.0 أو أعلى لاستخدام هذه الميزة.
</Info>
<Steps>
<Step title="الانتقال إلى إعدادات الطاقم">
في لوحة تحكم CrewAI AMP، اختر طاقمك المنشور وانتقل إلى أحد عمليات النشر/الأتمتة، ثم انتقل إلى **Settings** → **PII Protection**.
</Step>
<Step title="تفعيل حماية البيانات الشخصية">
فعّل **PII Redaction for Traces**. سيؤدي ذلك إلى تفعيل المسح والإخفاء التلقائي لبيانات التتبع.
<Info>
تحتاج إلى تفعيل إخفاء البيانات الشخصية يدوياً لكل عملية نشر.
</Info>
<Frame>
![تفعيل إخفاء البيانات الشخصية](/images/enterprise/pii_mask_recognizer_enable.png)
</Frame>
</Step>
<Step title="تهيئة أنواع الكيانات">
اختر أنواع البيانات الشخصية التي تريد اكتشافها وإخفاءها. يمكن تفعيل أو تعطيل كل كيان بشكل فردي.
<Frame>
![تهيئة الكيانات](/images/enterprise/pii_mask_recognizer_supported_entities.png)
</Frame>
</Step>
<Step title="الحفظ">
احفظ تهيئتك. سيكون إخفاء البيانات الشخصية نشطاً في جميع عمليات تنفيذ الطاقم اللاحقة، دون الحاجة لإعادة النشر.
</Step>
</Steps>
## أنواع الكيانات المدعومة
يدعم CrewAI أنواع كيانات PII التالية، منظمة حسب الفئة.
### الكيانات العالمية
| الكيان | الوصف | مثال |
|--------|-------|------|
| `CREDIT_CARD` | أرقام بطاقات الائتمان/الخصم | "4111-1111-1111-1111" |
| `CRYPTO` | عناوين محافظ العملات الرقمية | "bc1qxy2kgd..." |
| `DATE_TIME` | التواريخ والأوقات | "January 15, 2024" |
| `EMAIL_ADDRESS` | عناوين البريد الإلكتروني | "john@example.com" |
| `IBAN_CODE` | أرقام الحسابات المصرفية الدولية | "DE89 3704 0044 0532 0130 00" |
| `IP_ADDRESS` | عناوين IPv4 وIPv6 | "192.168.1.1" |
| `LOCATION` | المواقع الجغرافية | "New York City" |
| `MEDICAL_LICENSE` | أرقام التراخيص الطبية | "MD12345" |
| `NRP` | الجنسيات أو المجموعات الدينية أو السياسية | - |
| `PERSON` | الأسماء الشخصية | "John Doe" |
| `PHONE_NUMBER` | أرقام الهواتف بتنسيقات مختلفة | "+1 (555) 123-4567" |
| `URL` | عناوين URL | "https://example.com" |
### كيانات خاصة بالولايات المتحدة
| الكيان | الوصف | مثال |
|--------|-------|------|
| `US_BANK_NUMBER` | أرقام الحسابات المصرفية الأمريكية | "1234567890" |
| `US_DRIVER_LICENSE` | أرقام رخص القيادة الأمريكية | "D1234567" |
| `US_ITIN` | رقم تعريف دافع الضرائب الفردي | "900-70-0000" |
| `US_PASSPORT` | أرقام جوازات السفر الأمريكية | "123456789" |
| `US_SSN` | أرقام الضمان الاجتماعي | "123-45-6789" |
## إجراءات الإخفاء
لكل كيان مُفعّل، يمكنك تهيئة كيفية إخفاء البيانات:
| الإجراء | الوصف | مثال على المخرجات |
|---------|-------|-------------------|
| `mask` | الاستبدال بتسمية نوع الكيان | `<CREDIT_CARD>` |
| `redact` | إزالة النص بالكامل | *(فارغ)* |
## المُعرّفات المخصصة
بالإضافة إلى الكيانات المدمجة، يمكنك إنشاء **مُعرّفات مخصصة** لاكتشاف أنماط PII الخاصة بمؤسستك.
<Frame>
![المُعرّفات المخصصة](/images/enterprise/pii_mask_recognizer.png)
</Frame>
### أنواع المُعرّفات
لديك خياران للمُعرّفات المخصصة:
| النوع | الأفضل لـ | مثال على حالة الاستخدام |
|-------|-----------|------------------------|
| **قائم على النمط (Regex)** | بيانات منظمة بتنسيقات متوقعة | مبالغ الرواتب، معرّفات الموظفين، رموز المشاريع |
| **قائمة الحظر (Deny-list)** | مطابقة النصوص بالضبط | أسماء الشركات، الأسماء الرمزية الداخلية، مصطلحات محددة |
### إنشاء مُعرّف مخصص
<Steps>
<Step title="الانتقال إلى المُعرّفات المخصصة">
انتقل إلى **Settings** → **Organization** → **Add Recognizer** في إعدادات مؤسستك.
</Step>
<Step title="تهيئة المُعرّف">
<Frame>
![تهيئة المُعرّف](/images/enterprise/pii_mask_recognizer_create.png)
</Frame>
هيّئ الحقول التالية:
- **Name**: اسم وصفي للمُعرّف
- **Entity Type**: تسمية الكيان التي ستظهر في المخرجات المُخفاة (مثل `EMPLOYEE_ID`، `SALARY`)
- **Type**: اختر بين Regex Pattern أو Deny List
- **Pattern/Values**: نمط Regex أو قائمة نصوص للمطابقة
- **Confidence Threshold**: الحد الأدنى للنتيجة (0.0-1.0) المطلوبة لتفعيل الإخفاء عند المطابقة. القيم الأعلى (مثل 0.8) تقلل الإيجابيات الخاطئة لكن قد تفوّت بعض المطابقات. القيم الأقل (مثل 0.5) تلتقط المزيد من المطابقات لكن قد تُفرط في الإخفاء. القيمة الافتراضية هي 0.8.
- **Context Words** (اختياري): كلمات تزيد ثقة الاكتشاف عند وجودها بالقرب
</Step>
<Step title="الحفظ">
احفظ المُعرّف. سيكون متاحاً للتفعيل في عمليات النشر الخاصة بك.
</Step>
</Steps>
### فهم أنواع الكيانات
يحدد **Entity Type** كيفية ظهور المحتوى المُطابق في التتبعات المُخفاة:
```
Entity Type: SALARY
Pattern: salary:\s*\$\s*\d+
Input: "Employee salary: $50,000"
Output: "Employee <SALARY>"
```
### استخدام كلمات السياق
تحسّن كلمات السياق الدقة عن طريق زيادة الثقة عند ظهور مصطلحات محددة بالقرب من النمط المُطابق:
```
Context Words: "project", "code", "internal"
Entity Type: PROJECT_CODE
Pattern: PRJ-\d{4}
```
عندما تظهر كلمة "project" أو "code" بالقرب من "PRJ-1234"، يكون لدى المُعرّف ثقة أعلى بأنها مطابقة حقيقية، مما يقلل الإيجابيات الخاطئة.
## عرض التتبعات المُخفاة
بمجرد تفعيل إخفاء البيانات الشخصية، ستعرض تتبعاتك قيماً مُخفاة بدلاً من البيانات الحساسة:
```
Task Output: "Customer <PERSON> placed order #12345.
Contact email: <EMAIL_ADDRESS>, phone: <PHONE_NUMBER>.
Payment processed for card ending in <CREDIT_CARD>."
```
القيم المُخفاة مُعلّمة بوضوح بأقواس زاوية وتسمية نوع الكيان (مثل `<EMAIL_ADDRESS>`)، مما يسهّل فهم البيانات التي تمت حمايتها مع السماح لك بتصحيح الأخطاء ومراقبة سلوك الطاقم.
## أفضل الممارسات
### اعتبارات الأداء
<Steps>
<Step title="فعّل الكيانات المطلوبة فقط">
كل كيان مُفعّل يضيف عبء معالجة. فعّل فقط الكيانات ذات الصلة ببياناتك.
</Step>
<Step title="استخدم أنماطاً محددة">
للمُعرّفات المخصصة، استخدم أنماطاً محددة لتقليل الإيجابيات الخاطئة وتحسين الأداء. أنماط Regex هي الأفضل عند تحديد أنماط معينة في التتبعات مثل الرواتب ومعرّفات الموظفين ورموز المشاريع وغيرها. مُعرّفات قائمة الحظر هي الأفضل عند تحديد نصوص بعينها في التتبعات مثل أسماء الشركات والأسماء الرمزية الداخلية وغيرها.
</Step>
<Step title="استفد من كلمات السياق">
تحسّن كلمات السياق الدقة عن طريق تفعيل الاكتشاف فقط عندما يتطابق النص المحيط.
</Step>
</Steps>
## استكشاف الأخطاء وإصلاحها
<Accordion title="البيانات الشخصية لا تُخفى">
**الأسباب المحتملة:**
- نوع الكيان غير مُفعّل في التهيئة
- النمط لا يتطابق مع تنسيق البيانات
- المُعرّف المخصص يحتوي على أخطاء في الصياغة
**الحلول:**
- تحقق من أن الكيان مُفعّل في Settings → Security
- اختبر أنماط Regex مع بيانات نموذجية
- تحقق من السجلات بحثاً عن أخطاء التهيئة
</Accordion>
<Accordion title="إخفاء بيانات أكثر من اللازم">
**الأسباب المحتملة:**
- أنواع كيانات واسعة جداً مُفعّلة (مثل `DATE_TIME` تلتقط التواريخ في كل مكان)
- أنماط المُعرّف المخصص عامة جداً
**الحلول:**
- عطّل الكيانات التي تسبب إيجابيات خاطئة
- اجعل الأنماط المخصصة أكثر تحديداً
- أضف كلمات سياق لتحسين الدقة
</Accordion>
<Accordion title="مشاكل الأداء">
**الأسباب المحتملة:**
- عدد كبير جداً من الكيانات المُفعّلة
- الكيانات القائمة على NLP (مثل `PERSON` و`LOCATION` و`NRP`) مكلفة حسابياً لأنها تستخدم نماذج تعلم الآلة
**الحلول:**
- فعّل فقط الكيانات التي تحتاجها فعلاً
- فكّر في استخدام بدائل قائمة على الأنماط حيثما أمكن
- راقب أوقات معالجة التتبعات في لوحة التحكم
</Accordion>
---
## مثال عملي: مطابقة نمط الراتب
يوضح هذا المثال كيفية إنشاء مُعرّف مخصص لاكتشاف وإقناع معلومات الرواتب في تتبعاتك.
### حالة الاستخدام
يعالج طاقمك بيانات موظفين أو بيانات مالية تتضمن معلومات رواتب بتنسيقات مثل:
- `salary: $50,000`
- `salary: $125,000.00`
- `salary:$1,500.50`
تريد إقناع هذه القيم تلقائياً لحماية بيانات التعويضات الحساسة.
### التهيئة
<Frame>
![تهيئة مُعرّف الراتب](/images/enterprise/pii_mask_custom_recognizer_salary.png)
</Frame>
| الحقل | القيمة |
|-------|--------|
| **Name** | `SALARY` |
| **Entity Type** | `SALARY` |
| **Type** | Regex Pattern |
| **Regex Pattern** | `salary:\s*\$\s*\d{1,3}(,\d{3})*(\.\d{2})?` |
| **Action** | Mask |
| **Confidence Threshold** | `0.8` |
| **Context Words** | `salary, compensation, pay, wage, income` |
### تحليل نمط Regex
| مكون النمط | المعنى |
|------------|--------|
| `salary:` | يطابق النص الحرفي "salary:" |
| `\s*` | يطابق صفر أو أكثر من أحرف المسافات البيضاء |
| `\$` | يطابق علامة الدولار (مُهرّبة) |
| `\s*` | يطابق صفر أو أكثر من أحرف المسافات البيضاء بعد $ |
| `\d{1,3}` | يطابق 1-3 أرقام (مثل "1"، "50"، "125") |
| `(,\d{3})*` | يطابق الآلاف المفصولة بفواصل (مثل ",000"، ",500,000") |
| `(\.\d{2})?` | يطابق اختيارياً السنتات (مثل ".00"، ".50") |
### أمثلة على النتائج
```
Original: "Employee record shows salary: $125,000.00 annually"
Redacted: "Employee record shows <SALARY> annually"
Original: "Base salary:$50,000 with bonus potential"
Redacted: "Base <SALARY> with bonus potential"
```
<Tip>
إضافة كلمات سياق مثل "salary" و"compensation" و"pay" و"wage" و"income" تساعد في زيادة ثقة الاكتشاف عند ظهور هذه المصطلحات بالقرب من النمط المُطابق، مما يقلل الإيجابيات الخاطئة.
</Tip>
### تفعيل المُعرّف لعمليات النشر
<Warning>
إنشاء مُعرّف مخصص على مستوى المؤسسة لا يفعّله تلقائياً لعمليات النشر. يجب عليك تفعيل كل مُعرّف يدوياً لكل عملية نشر تريد تطبيقه عليها.
</Warning>
بعد إنشاء المُعرّف المخصص، فعّله لكل عملية نشر:
<Steps>
<Step title="الانتقال إلى عملية النشر">
انتقل إلى عملية النشر/الأتمتة وافتح **Settings** → **PII Protection**.
</Step>
<Step title="اختيار المُعرّفات المخصصة">
تحت **Mask Recognizers**، سترى المُعرّفات المحددة على مستوى مؤسستك. حدد المربع بجانب المُعرّفات التي تريد تفعيلها.
<Frame>
![تفعيل المُعرّف المخصص](/images/enterprise/pii_mask_recognizers_options.png)
</Frame>
</Step>
<Step title="حفظ التهيئة">
احفظ تغييراتك. سيكون المُعرّف نشطاً في جميع عمليات التنفيذ اللاحقة لعملية النشر هذه.
</Step>
</Steps>
<Info>
كرر هذه العملية لكل عملية نشر تحتاج فيها إلى المُعرّف المخصص. يمنحك ذلك تحكماً دقيقاً في المُعرّفات النشطة في البيئات المختلفة (مثل بيئة التطوير مقابل بيئة الإنتاج).
</Info>

View File

@@ -0,0 +1,107 @@
---
title: "التحكم في الوصول القائم على الأدوار (RBAC)"
description: "تحكم في الوصول إلى الطواقم والأدوات والبيانات باستخدام الأدوار والنطاقات والصلاحيات الدقيقة."
icon: "shield"
mode: "wide"
---
## نظرة عامة
يتيح RBAC في CrewAI AMP إدارة وصول آمنة وقابلة للتوسع من خلال مزيج من الأدوار على مستوى المؤسسة وعناصر التحكم في الرؤية على مستوى الأتمتة.
<Frame>
<img src="/images/enterprise/users_and_roles.png" alt="نظرة عامة على RBAC في CrewAI AMP" />
</Frame>
## المستخدمون والأدوار
يُعيَّن لكل عضو في مساحة عمل CrewAI دور يحدد صلاحيات الوصول عبر الميزات المختلفة.
يمكنك:
- استخدام الأدوار المحددة مسبقاً (Owner، Member)
- إنشاء أدوار مخصصة مصممة لصلاحيات محددة
- تعيين الأدوار في أي وقت عبر لوحة الإعدادات
يمكنك تهيئة المستخدمين والأدوار في Settings → Roles.
<Steps>
<Step title="فتح إعدادات الأدوار">
انتقل إلى <b>Settings → Roles</b> في CrewAI AMP.
</Step>
<Step title="اختيار نوع الدور">
استخدم دوراً محدداً مسبقاً (<b>Owner</b>، <b>Member</b>) أو انقر على{" "}
<b>Create role</b> لتحديد دور مخصص.
</Step>
<Step title="التعيين للأعضاء">
اختر المستخدمين وعيّن لهم الدور. يمكنك تغيير ذلك في أي وقت.
</Step>
</Steps>
### ملخص التهيئة
| المجال | مكان التهيئة | الخيارات |
| :-------------------- | :--------------------------------- | :-------------------------------------- |
| المستخدمون والأدوار | Settings → Roles | محددة مسبقاً: Owner، Member؛ أدوار مخصصة |
| رؤية الأتمتة | Automation → Settings → Visibility | خاص؛ قائمة بيضاء للمستخدمين/الأدوار |
## التحكم في الوصول على مستوى الأتمتة
بالإضافة إلى الأدوار على مستوى المؤسسة، تدعم أتمتات CrewAI إعدادات رؤية دقيقة تتيح لك تقييد الوصول إلى أتمتات محددة حسب المستخدم أو الدور.
هذا مفيد لـ:
- الحفاظ على خصوصية الأتمتات الحساسة أو التجريبية
- إدارة الرؤية عبر الفرق الكبيرة أو المتعاونين الخارجيين
- اختبار الأتمتات في سياقات معزولة
يمكن تهيئة عمليات النشر كخاصة، مما يعني أن المستخدمين والأدوار المدرجين في القائمة البيضاء فقط سيتمكنون من:
- عرض عملية النشر
- تشغيلها أو التفاعل مع API الخاص بها
- الوصول إلى سجلاتها ومقاييسها وإعداداتها
يتمتع مالك المؤسسة دائماً بالوصول، بغض النظر عن إعدادات الرؤية.
يمكنك تهيئة التحكم في الوصول على مستوى الأتمتة في Automation → Settings → علامة تبويب Visibility.
<Steps>
<Step title="فتح علامة تبويب الرؤية">
انتقل إلى <b>Automation → Settings → Visibility</b>.
</Step>
<Step title="ضبط الرؤية">
اختر <b>Private</b> لتقييد الوصول. يحتفظ مالك المؤسسة دائماً
بالوصول.
</Step>
<Step title="القائمة البيضاء للوصول">
أضف مستخدمين وأدواراً محددة مسموح لهم بالعرض والتشغيل والوصول
إلى السجلات/المقاييس/الإعدادات.
</Step>
<Step title="الحفظ والتحقق">
احفظ التغييرات، ثم تأكد من أن المستخدمين غير المدرجين في القائمة البيضاء لا يمكنهم عرض أو تشغيل
الأتمتة.
</Step>
</Steps>
### الرؤية الخاصة: نتائج الوصول
| الإجراء | المالك | مستخدم/دور في القائمة البيضاء | غير مدرج في القائمة البيضاء |
| :--------------------------- | :---- | :---------------------------- | :-------------------------- |
| عرض الأتمتة | ✓ | ✓ | ✗ |
| تشغيل الأتمتة/API | ✓ | ✓ | ✗ |
| الوصول إلى السجلات/المقاييس/الإعدادات | ✓ | ✓ | ✗ |
<Tip>
يتمتع مالك المؤسسة دائماً بالوصول. في الوضع الخاص، يمكن فقط للمستخدمين
والأدوار المدرجين في القائمة البيضاء العرض والتشغيل والوصول إلى السجلات/المقاييس/الإعدادات.
</Tip>
<Frame>
<img src="/images/enterprise/visibility.png" alt="إعدادات رؤية الأتمتة في CrewAI AMP" />
</Frame>
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للمساعدة في أسئلة RBAC.
</Card>

View File

@@ -0,0 +1,261 @@
---
title: الأدوات والتكاملات
description: "اربط التطبيقات الخارجية وأدِر الأدوات الداخلية التي يمكن لوكلائك استخدامها."
icon: "wrench"
mode: "wide"
---
## نظرة عامة
الأدوات والتكاملات هي المركز الرئيسي لربط تطبيقات الجهات الخارجية وإدارة الأدوات الداخلية التي يمكن لوكلائك استخدامها أثناء التشغيل.
<Frame>
![نظرة عامة على الأدوات والتكاملات](/images/enterprise/crew_connectors.png)
</Frame>
## استكشاف
<Tabs>
<Tab title="التكاملات" icon="plug">
## تطبيقات الوكلاء (التكاملات)
اربط تطبيقات المؤسسات (مثل Gmail وGoogle Drive وHubSpot وSlack) عبر OAuth لتمكين إجراءات الوكلاء.
{" "}
<Steps>
<Step title="الاتصال">
انقر على <b>Connect</b> في أحد التطبيقات وأكمل عملية OAuth.
</Step>
<Step title="التهيئة">
عدّل اختيارياً النطاقات والمشغلات وتوفر الإجراءات.
</Step>
<Step title="الاستخدام في الوكلاء">
تصبح الخدمات المتصلة متاحة كأدوات لوكلائك.
</Step>
</Steps>
{" "}
<Frame>![شبكة التكاملات](/images/enterprise/agent-apps.png)</Frame>
### ربط حسابك
1. انتقل إلى <Link href="https://app.crewai.com/crewai_plus/connectors">Integrations</Link>
2. انقر على <b>Connect</b> في الخدمة المطلوبة
3. أكمل تدفق OAuth وامنح النطاقات
4. انسخ رمز Enterprise من <Link href="https://app.crewai.com/crewai_plus/settings/integrations">Integration Settings</Link>
{" "}
<Frame>
![رمز Enterprise](/images/enterprise/enterprise_action_auth_token.png)
</Frame>
### تثبيت أدوات التكامل
لاستخدام التكاملات محلياً، تحتاج إلى تثبيت أحدث حزمة `crewai-tools`.
```bash
uv add crewai-tools
```
### إعداد متغيرات البيئة
{" "}
<Note>
لاستخدام التكاملات مع `Agent(apps=[])` يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز Enterprise الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
### مثال على الاستخدام
{" "}
<Tip>
استخدم النهج المبسط الجديد لدمج تطبيقات المؤسسات. ما عليك سوى تحديد
التطبيق وإجراءاته مباشرة في تهيئة Agent.
</Tip>
```python
from crewai import Agent, Task, Crew
# Create an agent with Gmail capabilities
email_agent = Agent(
role="Email Manager",
goal="Manage and organize email communications",
backstory="An AI assistant specialized in email management and communication.",
apps=['gmail', 'gmail/send_email'] # Using canonical name 'gmail'
)
# Task to send an email
email_task = Task(
description="Draft and send a follow-up email to john@example.com about the project update",
agent=email_agent,
expected_output="Confirmation that email was sent successfully"
)
# Run the task
crew = Crew(
agents=[email_agent],
tasks=[email_task]
)
# Run the crew
crew.kickoff()
```
### تصفية الأدوات
```python
from crewai import Agent, Task, Crew
# Create agent with specific Gmail actions only
gmail_agent = Agent(
role="Gmail Manager",
goal="Manage gmail communications and notifications",
backstory="An AI assistant that helps coordinate gmail communications.",
apps=['gmail/fetch_emails'] # Using canonical name with specific action
)
notification_task = Task(
description="Find the email from john@example.com",
agent=gmail_agent,
expected_output="Email found from john@example.com"
)
crew = Crew(
agents=[gmail_agent],
tasks=[notification_task]
)
```
في الطاقم المنشور، يمكنك تحديد الإجراءات المتاحة لكل تكامل من صفحة إعدادات الخدمة.
{" "}
<Frame>
![تصفية الإجراءات](/images/enterprise/filtering_enterprise_action_tools.png)
</Frame>
### عمليات النشر المحددة النطاق (مؤسسات متعددة المستخدمين)
يمكنك تحديد نطاق كل تكامل لمستخدم معين. على سبيل المثال، طاقم يتصل بـ Google يمكنه استخدام حساب Gmail لمستخدم محدد.
{" "}
<Tip>مفيد عندما تحتاج فرق/مستخدمون مختلفون للحفاظ على فصل الوصول إلى البيانات.</Tip>
استخدم `user_bearer_token` لتحديد نطاق المصادقة للمستخدم الطالب. إذا لم يكن المستخدم مسجل الدخول، فلن يستخدم الطاقم التكاملات المتصلة. وإلا فسيعود إلى رمز الحامل الافتراضي المهيأ لعملية النشر.
{" "}
<Frame>![رمز حامل المستخدم](/images/enterprise/user_bearer_token.png)</Frame>
{" "}
<div id="catalog"></div>
### الكتالوج
#### الاتصالات والتعاون
- Gmail — إدارة الرسائل الإلكترونية والمسودات
- Slack — إشعارات وتنبيهات مساحة العمل
- Microsoft — تكامل Office 365 وTeams
#### إدارة المشاريع
- Jira — تتبع المشكلات وإدارة المشاريع
- ClickUp — إدارة المهام والإنتاجية
- Asana — تنسيق مهام ومشاريع الفريق
- Notion — إدارة الصفحات وقواعد البيانات
- Linear — تتبع مشاريع البرمجيات والأخطاء
- GitHub — إدارة المستودعات والمشكلات
#### إدارة علاقات العملاء
- Salesforce — إدارة حسابات وفرص CRM
- HubSpot — إدارة خط أنابيب المبيعات وجهات الاتصال
- Zendesk — إدارة تذاكر دعم العملاء
#### الأعمال والمالية
- Stripe — معالجة المدفوعات وإدارة العملاء
- Shopify — إدارة متجر ومنتجات التجارة الإلكترونية
#### الإنتاجية والتخزين
- Google Sheets — مزامنة بيانات جداول البيانات
- Google Calendar — إدارة الأحداث والجداول
- Box — تخزين الملفات وإدارة المستندات
...والمزيد قادم!
</Tab>
<Tab title="الأدوات الداخلية" icon="toolbox">
## الأدوات الداخلية
أنشئ أدوات مخصصة محلياً، وانشرها في مستودع أدوات CrewAI AMP واستخدمها في وكلائك.
{" "}
<Tip>
قبل تشغيل الأوامر أدناه، تأكد من تسجيل الدخول إلى حساب CrewAI AMP
بتشغيل هذا الأمر: ```bash crewai login ```
</Tip>
{" "}
<Frame>
![تفاصيل الأداة الداخلية](/images/enterprise/tools-integrations-internal.png)
</Frame>
{" "}
<Steps>
<Step title="الإنشاء">
أنشئ أداة جديدة محلياً. ```bash crewai tool create your-tool ```
</Step>
<Step title="النشر">
انشر الأداة في مستودع أدوات CrewAI AMP. ```bash crewai tool
publish ```
</Step>
<Step title="التثبيت">
ثبّت الأداة من مستودع أدوات CrewAI AMP. ```bash crewai tool
install your-tool ```
</Step>
</Steps>
الإدارة:
- الاسم والوصف
- الرؤية (خاص / عام)
- متغيرات البيئة المطلوبة
- سجل الإصدارات والتنزيلات
- وصول الفرق والأدوار
{" "}
<Frame>![تفاصيل الأداة الداخلية](/images/enterprise/tool-configs.png)</Frame>
</Tab>
</Tabs>
## ذو صلة
<CardGroup cols={2}>
<Card
title="مستودع الأدوات"
href="/ar/enterprise/guides/tool-repository#tool-repository"
icon="toolbox"
>
أنشئ وانشر وأدِر إصدارات الأدوات المخصصة لمؤسستك.
</Card>
<Card
title="أتمتة Webhook"
href="/ar/enterprise/guides/webhook-automation"
icon="bolt"
>
أتمت سير العمل وتكامل مع المنصات والخدمات الخارجية.
</Card>
</CardGroup>

View File

@@ -0,0 +1,148 @@
---
title: التتبعات
description: "استخدام التتبعات لمراقبة طواقمك"
icon: "timeline"
mode: "wide"
---
## نظرة عامة
توفر التتبعات رؤية شاملة لعمليات تنفيذ طواقمك، مما يساعدك على مراقبة الأداء وتصحيح الأخطاء وتحسين سير عمل وكلاء الذكاء الاصطناعي.
## ما هي التتبعات؟
التتبعات في CrewAI AMP هي سجلات تنفيذ مفصلة تلتقط كل جانب من جوانب عمل طاقمك، من المدخلات الأولية إلى المخرجات النهائية. تسجل:
- أفكار الوكلاء واستدلالاتهم
- تفاصيل تنفيذ المهام
- استخدام الأدوات ومخرجاتها
- مقاييس استهلاك الرموز
- أوقات التنفيذ
- تقديرات التكلفة
<Frame>![نظرة عامة على التتبعات](/images/enterprise/traces-overview.png)</Frame>
## الوصول إلى التتبعات
<Steps>
<Step title="الانتقال إلى علامة تبويب التتبعات">
في لوحة تحكم CrewAI AMP، انقر على **Traces** لعرض جميع سجلات التنفيذ.
</Step>
<Step title="اختيار عملية تنفيذ">
سترى قائمة بجميع عمليات تنفيذ الطاقم، مرتبة حسب التاريخ. انقر على أي عملية تنفيذ لعرض تتبعها المفصل.
</Step>
</Steps>
## فهم واجهة التتبع
تنقسم واجهة التتبع إلى عدة أقسام، يقدم كل منها رؤى مختلفة حول تنفيذ طاقمك:
### 1. ملخص التنفيذ
يعرض القسم العلوي مقاييس عالية المستوى حول التنفيذ:
- **إجمالي الرموز**: عدد الرموز المستهلكة عبر جميع المهام
- **رموز الطلب**: الرموز المستخدمة في الطلبات إلى LLM
- **رموز الإكمال**: الرموز المُنشأة في استجابات LLM
- **الطلبات**: عدد استدعاءات API المُجراة
- **وقت التنفيذ**: المدة الإجمالية لتشغيل الطاقم
- **التكلفة المقدرة**: التكلفة التقريبية بناءً على استخدام الرموز
<Frame>![ملخص التنفيذ](/images/enterprise/trace-summary.png)</Frame>
### 2. المهام والوكلاء
يعرض هذا القسم جميع المهام والوكلاء الذين كانوا جزءاً من تنفيذ الطاقم:
- اسم المهمة وتعيين الوكيل
- الوكلاء ونماذج LLM المستخدمة لكل مهمة
- الحالة (مكتملة/فاشلة)
- وقت التنفيذ الفردي للمهمة
<Frame>![قائمة المهام](/images/enterprise/trace-tasks.png)</Frame>
### 3. المخرجات النهائية
يعرض النتيجة النهائية التي أنتجها الطاقم بعد اكتمال جميع المهام.
<Frame>![المخرجات النهائية](/images/enterprise/final-output.png)</Frame>
### 4. الجدول الزمني للتنفيذ
تمثيل مرئي لوقت بدء وانتهاء كل مهمة، يساعدك على تحديد نقاط الاختناق أو أنماط التنفيذ المتوازي.
<Frame>![الجدول الزمني للتنفيذ](/images/enterprise/trace-timeline.png)</Frame>
### 5. عرض المهمة المفصل
عند النقر على مهمة محددة في الجدول الزمني أو قائمة المهام، سترى:
<Frame>![عرض المهمة المفصل](/images/enterprise/trace-detailed-task.png)</Frame>
- **مفتاح المهمة**: معرّف فريد للمهمة
- **معرّف المهمة**: معرّف تقني في النظام
- **الحالة**: الحالة الحالية (مكتملة/قيد التشغيل/فاشلة)
- **الوكيل**: الوكيل الذي نفّذ المهمة
- **LLM**: نموذج اللغة المستخدم لهذه المهمة
- **وقت البدء/الانتهاء**: متى بدأت المهمة واكتملت
- **وقت التنفيذ**: مدة هذه المهمة المحددة
- **وصف المهمة**: ما طُلب من الوكيل تنفيذه
- **المخرجات المتوقعة**: تنسيق المخرجات المطلوب
- **المدخلات**: أي مدخلات مقدمة لهذه المهمة من مهام سابقة
- **المخرجات**: النتيجة الفعلية التي أنتجها الوكيل
## استخدام التتبعات لتصحيح الأخطاء
التتبعات لا تقدر بثمن لاستكشاف المشكلات في طواقمك:
<Steps>
<Step title="تحديد نقاط الفشل">
عندما لا ينتج تنفيذ الطاقم النتائج المتوقعة، افحص التتبع لمعرفة أين حدث الخطأ. ابحث عن:
- المهام الفاشلة
- قرارات الوكيل غير المتوقعة
- أخطاء استخدام الأدوات
- التعليمات المُساء فهمها
<Frame>
![نقاط الفشل](/images/enterprise/failure.png)
</Frame>
</Step>
<Step title="تحسين الأداء">
استخدم مقاييس التنفيذ لتحديد نقاط اختناق الأداء:
- المهام التي استغرقت وقتاً أطول من المتوقع
- الاستخدام المفرط للرموز
- عمليات الأدوات المكررة
- استدعاءات API غير الضرورية
</Step>
<Step title="تحسين كفاءة التكلفة">
حلل استخدام الرموز وتقديرات التكلفة لتحسين كفاءة طاقمك:
- فكّر في استخدام نماذج أصغر للمهام الأبسط
- صقل الطلبات لتكون أكثر إيجازاً
- خزّن المعلومات المُوصول إليها بشكل متكرر مؤقتاً
- نظّم المهام لتقليل العمليات المكررة
</Step>
</Steps>
## الأداء والتجميع
يجمّع CrewAI تحميلات التتبع لتقليل العبء في عمليات التشغيل ذات الحجم الكبير:
- يقوم TraceBatchManager بتخزين الأحداث مؤقتاً وإرسالها في دفعات عبر عميل Plus API
- يقلل حركة الشبكة ويحسّن الموثوقية في الاتصالات غير المستقرة
- يُفعّل تلقائياً في مستمع التتبع الافتراضي؛ لا حاجة لتهيئة
يوفر ذلك تتبعاً أكثر استقراراً تحت الحمل مع الحفاظ على بيانات القياس المفصلة للمهام/الوكلاء.
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للمساعدة في تحليل التتبعات أو أي ميزات أخرى في
CrewAI AMP.
</Card>

View File

@@ -0,0 +1,172 @@
---
title: بث Webhook
description: "استخدام بث Webhook لإرسال الأحداث إلى webhook الخاص بك"
icon: "webhook"
mode: "wide"
---
## نظرة عامة
يتيح لك بث أحداث Enterprise تلقي تحديثات webhook في الوقت الفعلي حول طواقمك وتدفقاتك المنشورة على CrewAI AMP، مثل استدعاءات النماذج واستخدام الأدوات وخطوات التدفق.
## الاستخدام
عند استخدام Kickoff API، أضف كائن `webhooks` إلى طلبك، على سبيل المثال:
```json
{
"inputs": { "foo": "bar" },
"webhooks": {
"events": ["crew_kickoff_started", "llm_call_started"],
"url": "https://your.endpoint/webhook",
"realtime": false,
"authentication": {
"strategy": "bearer",
"token": "my-secret-token"
}
}
}
```
إذا تم تعيين `realtime` إلى `true`، يتم تسليم كل حدث بشكل فردي وفوري، على حساب أداء الطاقم/التدفق.
## تنسيق Webhook
يرسل كل webhook قائمة بالأحداث:
```json
{
"events": [
{
"id": "event-id",
"execution_id": "crew-run-id",
"timestamp": "2025-02-16T10:58:44.965Z",
"type": "llm_call_started",
"data": {
"model": "gpt-4",
"messages": [
{ "role": "system", "content": "You are an assistant." },
{ "role": "user", "content": "Summarize this article." }
]
}
}
]
}
```
يختلف هيكل كائن `data` حسب نوع الحدث. راجع [قائمة الأحداث](https://github.com/crewAIInc/crewAI/tree/main/lib/crewai/src/crewai/events/types) على GitHub.
نظراً لأن الطلبات تُرسل عبر HTTP، لا يمكن ضمان ترتيب الأحداث. إذا كنت تحتاج الترتيب، استخدم حقل `timestamp`.
## الأحداث المدعومة
يدعم CrewAI كلاً من أحداث النظام والأحداث المخصصة في بث أحداث Enterprise. تُرسل هذه الأحداث إلى نقطة نهاية webhook المُهيأة أثناء تنفيذ الطاقم والتدفق.
### أحداث التدفق:
- `flow_created`
- `flow_started`
- `flow_finished`
- `flow_plot`
- `method_execution_started`
- `method_execution_finished`
- `method_execution_failed`
### أحداث الوكيل:
- `agent_execution_started`
- `agent_execution_completed`
- `agent_execution_error`
- `lite_agent_execution_started`
- `lite_agent_execution_completed`
- `lite_agent_execution_error`
- `agent_logs_started`
- `agent_logs_execution`
- `agent_evaluation_started`
- `agent_evaluation_completed`
- `agent_evaluation_failed`
### أحداث الطاقم:
- `crew_kickoff_started`
- `crew_kickoff_completed`
- `crew_kickoff_failed`
- `crew_train_started`
- `crew_train_completed`
- `crew_train_failed`
- `crew_test_started`
- `crew_test_completed`
- `crew_test_failed`
- `crew_test_result`
### أحداث المهام:
- `task_started`
- `task_completed`
- `task_failed`
- `task_evaluation`
### أحداث استخدام الأدوات:
- `tool_usage_started`
- `tool_usage_finished`
- `tool_usage_error`
- `tool_validate_input_error`
- `tool_selection_error`
- `tool_execution_error`
### أحداث LLM:
- `llm_call_started`
- `llm_call_completed`
- `llm_call_failed`
- `llm_stream_chunk`
### أحداث حواجز LLM:
- `llm_guardrail_started`
- `llm_guardrail_completed`
### أحداث الذاكرة:
- `memory_query_started`
- `memory_query_completed`
- `memory_query_failed`
- `memory_save_started`
- `memory_save_completed`
- `memory_save_failed`
- `memory_retrieval_started`
- `memory_retrieval_completed`
### أحداث المعرفة:
- `knowledge_search_query_started`
- `knowledge_search_query_completed`
- `knowledge_search_query_failed`
- `knowledge_query_started`
- `knowledge_query_completed`
- `knowledge_query_failed`
### أحداث الاستدلال:
- `agent_reasoning_started`
- `agent_reasoning_completed`
- `agent_reasoning_failed`
تتطابق أسماء الأحداث مع ناقل الأحداث الداخلي. راجع GitHub للقائمة الكاملة للأحداث.
يمكنك إصدار أحداثك المخصصة الخاصة، وسيتم تسليمها عبر تدفق webhook جنباً إلى جنب مع أحداث النظام.
<CardGroup>
<Card
title="GitHub"
icon="github"
href="https://github.com/crewAIInc/crewAI/tree/main/src/crewai/utilities/events"
>
القائمة الكاملة للأحداث
</Card>
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للمساعدة في تكامل webhook أو
استكشاف الأخطاء.
</Card>
</CardGroup>

View File

@@ -0,0 +1,321 @@
---
title: "نظرة عامة على المشغلات"
description: "فهم كيفية عمل مشغلات CrewAI AMP وكيفية إدارتها وأين تجد أدلة التكامل الخاصة بكل خدمة"
icon: "face-smile"
mode: "wide"
---
تربط مشغلات CrewAI AMP أتمتاتك بالأحداث الفورية عبر الأدوات التي تستخدمها فرقك بالفعل. بدلاً من الاستعلام المتكرر عن الأنظمة أو الاعتماد على التشغيل اليدوي، تستمع المشغلات للتغييرات — رسائل بريد إلكتروني جديدة، تحديثات التقويم، تغييرات حالة CRM — وتطلق فوراً الطاقم أو التدفق الذي تحدده.
<Frame>
![نظرة عامة على مشغلات الأتمتة](/images/enterprise/crew_connectors.png)
</Frame>
### أدلة التكامل
تقدم الأدلة المفصلة شرحاً لعملية الإعداد وأمثلة على سير العمل لكل تكامل:
<CardGroup cols={2}>
<Card title="مشغل Gmail" icon="envelope">
<a href="/ar/enterprise/guides/gmail-trigger">فعّل الطواقم عند وصول رسائل بريد إلكتروني أو تحديث سلاسل المحادثات.</a>
</Card>
{" "}
<Card title="مشغل Google Calendar" icon="calendar-days">
<a href="/ar/enterprise/guides/google-calendar-trigger">
استجب لأحداث التقويم عند إنشائها أو تحديثها أو إلغائها.
</a>
</Card>
{" "}
<Card title="مشغل Google Drive" icon="folder-open">
<a href="/ar/enterprise/guides/google-drive-trigger">
تعامل مع تحميلات وتعديلات وحذف ملفات Drive.
</a>
</Card>
{" "}
<Card title="مشغل Outlook" icon="envelope-open">
<a href="/ar/enterprise/guides/outlook-trigger">
أتمت الاستجابات لرسائل Outlook الجديدة وتحديثات التقويم.
</a>
</Card>
{" "}
<Card title="مشغل OneDrive" icon="cloud">
<a href="/ar/enterprise/guides/onedrive-trigger">
راقب نشاط الملفات وتغييرات المشاركة في OneDrive.
</a>
</Card>
{" "}
<Card title="مشغل Microsoft Teams" icon="comments">
<a href="/ar/enterprise/guides/microsoft-teams-trigger">
ابدأ سير العمل عند إنشاء محادثات Teams جديدة.
</a>
</Card>
{" "}
<Card title="مشغل HubSpot" icon="hubspot">
<a href="/ar/enterprise/guides/hubspot-trigger">
أطلق الأتمتات من سير عمل HubSpot وأحداث دورة الحياة.
</a>
</Card>
{" "}
<Card title="مشغل Salesforce" icon="salesforce">
<a href="/ar/enterprise/guides/salesforce-trigger">
اربط عمليات Salesforce بـ CrewAI لأتمتة CRM.
</a>
</Card>
{" "}
<Card title="مشغل Slack" icon="slack">
<a href="/ar/enterprise/guides/slack-trigger">
ابدأ الطواقم مباشرة من أوامر Slack.
</a>
</Card>
<Card title="مشغل Zapier" icon="bolt">
<a href="/ar/enterprise/guides/zapier-trigger">اربط CrewAI بآلاف التطبيقات المدعومة من Zapier.</a>
</Card>
</CardGroup>
## قدرات المشغلات
مع المشغلات، يمكنك:
- **الاستجابة للأحداث الفورية** - تنفيذ سير العمل تلقائياً عند استيفاء شروط محددة
- **التكامل مع الأنظمة الخارجية** - الاتصال بمنصات مثل Gmail وOutlook وOneDrive وJIRA وSlack وStripe والمزيد
- **توسيع نطاق الأتمتة** - التعامل مع أحداث كبيرة الحجم دون تدخل يدوي
- **الحفاظ على السياق** - الوصول إلى بيانات المشغل داخل طواقمك وتدفقاتك
## إدارة المشغلات
### عرض المشغلات المتاحة
للوصول إلى مشغلات الأتمتة وإدارتها:
1. انتقل إلى عملية النشر في لوحة تحكم CrewAI
2. انقر على علامة تبويب **Triggers** لعرض جميع تكاملات المشغلات المتاحة
<Frame caption="مثال على مشغلات الأتمتة المتاحة لنشر Gmail">
<img
src="/images/enterprise/list-available-triggers.png"
alt="قائمة مشغلات الأتمتة المتاحة"
/>
</Frame>
يعرض هذا العرض جميع تكاملات المشغلات المتاحة لعملية النشر، مع حالة الاتصال الحالية.
### تفعيل وتعطيل المشغلات
يمكن تفعيل أو تعطيل كل مشغل بسهولة باستخدام مفتاح التبديل:
<Frame caption="تفعيل أو تعطيل المشغلات بالتبديل">
<img
src="/images/enterprise/trigger-selected.png"
alt="تفعيل أو تعطيل المشغلات بالتبديل"
/>
</Frame>
- **مُفعّل (تبديل أزرق)**: المشغل نشط وسينفذ عملية النشر تلقائياً عند حدوث الأحداث المحددة
- **مُعطّل (تبديل رمادي)**: المشغل غير نشط ولن يستجيب للأحداث
انقر ببساطة على التبديل لتغيير حالة المشغل. تسري التغييرات فوراً.
### مراقبة عمليات تنفيذ المشغلات
تتبع أداء وسجل عمليات التنفيذ المُشغّلة:
<Frame caption="قائمة عمليات التنفيذ المُشغّلة بواسطة الأتمتة">
<img
src="/images/enterprise/list-executions.png"
alt="قائمة عمليات التنفيذ المُشغّلة بواسطة الأتمتة"
/>
</Frame>
## بناء أتمتات مدفوعة بالمشغلات
قبل بناء أتمتتك، من المفيد فهم هيكل حمولات المشغلات التي ستتلقاها طواقمك وتدفقاتك.
### قائمة فحص إعداد المشغل
قبل ربط مشغل بالإنتاج، تأكد من:
- ربط التكامل تحت **Tools & Integrations** وإكمال خطوات OAuth أو مفتاح API
- تفعيل تبديل المشغل في عملية النشر التي يجب أن تستجيب للأحداث
- توفير متغيرات البيئة المطلوبة (رموز API، معرّفات المستأجر، الأسرار المشتركة)
- إنشاء أو تحديث المهام التي يمكنها تحليل الحمولة الواردة في أول مهمة طاقم أو خطوة تدفق
- تحديد ما إذا كنت ستمرر سياق المشغل تلقائياً باستخدام `allow_crewai_trigger_context`
- إعداد المراقبة — سجلات webhook وسجل تنفيذ CrewAI والتنبيهات الخارجية الاختيارية
### اختبار المشغلات محلياً باستخدام CLI
يوفر CrewAI CLI أوامر قوية لمساعدتك في تطوير واختبار الأتمتات المدفوعة بالمشغلات دون النشر في الإنتاج.
#### عرض المشغلات المتاحة
اعرض جميع المشغلات المتاحة للتكاملات المتصلة:
```bash
crewai triggers list
```
يعرض هذا الأمر جميع المشغلات المتاحة بناءً على تكاملاتك المتصلة، ويظهر:
- اسم التكامل وحالة الاتصال
- أنواع المشغلات المتاحة
- أسماء وأوصاف المشغلات
#### محاكاة تنفيذ المشغل
اختبر طاقمك بحمولات مشغل واقعية قبل النشر:
```bash
crewai triggers run <trigger_name>
```
على سبيل المثال:
```bash
crewai triggers run microsoft_onedrive/file_changed
```
يقوم هذا الأمر بـ:
- تنفيذ طاقمك محلياً
- تمرير حمولة مشغل كاملة وواقعية
- محاكاة كيفية استدعاء طاقمك في الإنتاج بالضبط
<Warning>
**ملاحظات تطوير مهمة:**
- استخدم `crewai triggers run <trigger>` لمحاكاة تنفيذ المشغل أثناء التطوير
- استخدام `crewai run` لن يحاكي استدعاءات المشغل ولن يمرر حمولة المشغل
- بعد النشر، سيتم تنفيذ طاقمك بحمولة المشغل الفعلية
- إذا كان طاقمك يتوقع معاملات غير موجودة في حمولة المشغل، فقد يفشل التنفيذ
</Warning>
### المشغلات مع الطاقم
تعمل تعريفات طاقمك الحالية بسلاسة مع المشغلات، تحتاج فقط إلى مهمة لتحليل الحمولة المستلمة:
```python
@CrewBase
class MyAutomatedCrew:
@agent
def researcher(self) -> Agent:
return Agent(
config=self.agents_config['researcher'],
)
@task
def parse_trigger_payload(self) -> Task:
return Task(
config=self.tasks_config['parse_trigger_payload'],
agent=self.researcher(),
)
@task
def analyze_trigger_content(self) -> Task:
return Task(
config=self.tasks_config['analyze_trigger_data'],
agent=self.researcher(),
)
```
سيتلقى الطاقم تلقائياً حمولة المشغل ويمكنه الوصول إليها عبر آليات سياق CrewAI القياسية.
<Note>
يمكن أن تتضمن مدخلات الطاقم والتدفق `crewai_trigger_payload`. يحقن CrewAI
هذه الحمولة تلقائياً: - المهام: تُلحق بوصف المهمة الأولى افتراضياً ("Trigger Payload: {crewai_trigger_payload}") - التحكم
عبر `allow_crewai_trigger_context`: عيّن `True` للحقن دائماً، `False` لعدم
الحقن أبداً - التدفقات: أي دالة `@start()` تقبل معامل
`crewai_trigger_payload` ستستلمه
</Note>
### التكامل مع التدفقات
للتدفقات، لديك تحكم أكبر في كيفية التعامل مع بيانات المشغل:
#### الوصول إلى حمولة المشغل
جميع دوال `@start()` في تدفقاتك ستقبل معاملاً إضافياً يسمى `crewai_trigger_payload`:
```python
from crewai.flow import Flow, start, listen
class MyAutomatedFlow(Flow):
@start()
def handle_trigger(self, crewai_trigger_payload: dict = None):
"""
This start method can receive trigger data
"""
if crewai_trigger_payload:
# Process the trigger data
trigger_id = crewai_trigger_payload.get('id')
event_data = crewai_trigger_payload.get('payload', {})
# Store in flow state for use by other methods
self.state.trigger_id = trigger_id
self.state.trigger_type = event_data
return event_data
# Handle manual execution
return None
@listen(handle_trigger)
def process_data(self, trigger_data):
"""
Process the data from the trigger
"""
# ... process the trigger
```
#### تشغيل الطواقم من التدفقات
عند تشغيل طاقم داخل تدفق تم تشغيله بمشغل، مرر حمولة المشغل كما هي:
```python
@start()
def delegate_to_crew(self, crewai_trigger_payload: dict = None):
"""
Delegate processing to a specialized crew
"""
crew = MySpecializedCrew()
# Pass the trigger payload to the crew
result = crew.crew().kickoff(
inputs={
'a_custom_parameter': "custom_value",
'crewai_trigger_payload': crewai_trigger_payload
},
)
return result
```
## استكشاف الأخطاء وإصلاحها
**المشغل لا يعمل:**
- تحقق من أن المشغل مُفعّل في علامة تبويب Triggers الخاصة بعملية النشر
- تحقق من حالة اتصال التكامل تحت Tools & Integrations
- تأكد من تهيئة جميع متغيرات البيئة المطلوبة بشكل صحيح
**فشل التنفيذ:**
- تحقق من سجلات التنفيذ لتفاصيل الأخطاء
- استخدم `crewai triggers run <trigger_name>` للاختبار محلياً ورؤية هيكل الحمولة بالضبط
- تحقق من أن طاقمك يمكنه التعامل مع معامل `crewai_trigger_payload`
- تأكد من أن طاقمك لا يتوقع معاملات غير مضمنة في حمولة المشغل
**مشاكل التطوير:**
- اختبر دائماً باستخدام `crewai triggers run <trigger>` قبل النشر لرؤية الحمولة الكاملة
- تذكر أن `crewai run` لا يحاكي استدعاءات المشغل — استخدم `crewai triggers run` بدلاً من ذلك
- استخدم `crewai triggers list` للتحقق من المشغلات المتاحة لتكاملاتك المتصلة
- بعد النشر، سيتلقى طاقمك حمولة المشغل الفعلية، لذا اختبر بدقة محلياً أولاً
تحوّل مشغلات الأتمتة عمليات نشر CrewAI إلى أنظمة استجابة مدفوعة بالأحداث يمكنها التكامل بسلاسة مع عمليات عملك وأدواتك الحالية.

View File

@@ -0,0 +1,54 @@
---
title: "إعداد Azure OpenAI"
description: "تهيئة Azure OpenAI مع Crew Studio لاتصالات LLM المؤسسية"
icon: "microsoft"
mode: "wide"
---
يرشدك هذا الدليل خلال ربط Azure OpenAI مع Crew Studio لعمليات الذكاء الاصطناعي المؤسسية السلسة.
## عملية الإعداد
<Steps>
<Step title="الوصول إلى Azure AI Foundry">
1. في Azure، انتقل إلى [Azure AI Foundry](https://ai.azure.com/) > اختر نشر Azure OpenAI الخاص بك.
2. في القائمة اليسرى، انقر على `Deployments`. إذا لم يكن لديك نشر، أنشئ واحداً بالنموذج المطلوب.
3. بمجرد الإنشاء، اختر النشر وحدد موقع `Target URI` و`Key` على الجانب الأيمن من الصفحة. أبقِ هذه الصفحة مفتوحة، حيث ستحتاج هذه المعلومات.
<Frame>
<img src="/images/enterprise/azure-openai-studio.png" alt="Azure AI Foundry" />
</Frame>
</Step>
<Step title="تهيئة اتصال CrewAI AMP">
4. في علامة تبويب أخرى، افتح `CrewAI AMP > LLM Connections`. سمِّ اتصال LLM، واختر Azure كمزود، واختر نفس النموذج الذي اخترته في Azure.
5. في نفس الصفحة، أضف متغيرات البيئة من الخطوة 3:
- واحد بالاسم `AZURE_DEPLOYMENT_TARGET_URL` (باستخدام Target URI). يجب أن يبدو الرابط هكذا: https://your-deployment.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-08-01-preview
- آخر بالاسم `AZURE_API_KEY` (باستخدام Key).
6. انقر على `Add Connection` لحفظ اتصال LLM.
</Step>
<Step title="ضبط التهيئة الافتراضية">
7. في `CrewAI AMP > Settings > Defaults > Crew Studio LLM Settings`، عيّن اتصال LLM والنموذج الجديدين كافتراضيين.
</Step>
<Step title="تهيئة الوصول إلى الشبكة">
8. تأكد من إعدادات الوصول إلى الشبكة:
- في Azure، انتقل إلى `Azure OpenAI > اختر النشر`.
- انتقل إلى `Resource Management > Networking`.
- تأكد من تفعيل `Allow access from all networks`. إذا كان هذا الإعداد مقيداً، فقد يُحظر وصول CrewAI إلى نقطة نهاية Azure OpenAI.
</Step>
</Steps>
## التحقق
أنت جاهز! سيستخدم Crew Studio الآن اتصال Azure OpenAI الخاص بك. اختبر الاتصال بإنشاء طاقم أو مهمة بسيطة للتأكد من أن كل شيء يعمل بشكل صحيح.
## استكشاف الأخطاء وإصلاحها
إذا واجهت مشكلات:
- تحقق من أن تنسيق Target URI يتطابق مع النمط المتوقع
- تحقق من صحة مفتاح API وأنه يملك الصلاحيات المناسبة
- تأكد من تهيئة الوصول إلى الشبكة للسماح باتصالات CrewAI
- تأكد من أن نموذج النشر يتطابق مع ما هيأته في CrewAI

View File

@@ -0,0 +1,48 @@
---
title: "بناء طاقم"
description: "الطاقم هو مجموعة من الوكلاء الذين يعملون معاً لإتمام مهمة."
icon: "people-arrows"
mode: "wide"
---
## نظرة عامة
يبسّط [CrewAI AMP](https://app.crewai.com) عملية **إنشاء** و**نشر** و**إدارة** وكلاء الذكاء الاصطناعي في بيئات الإنتاج.
## البدء
<iframe
className="w-full aspect-video rounded-xl"
src="https://www.youtube.com/embed/-kSOTtYzgEw"
title="بناء الطواقم باستخدام CrewAI CLI"
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
></iframe>
### التثبيت والإعداد
<Card
title="اتبع دليل التثبيت القياسي"
icon="wrench"
href="/ar/installation"
>
اتبع دليل التثبيت القياسي لإعداد CrewAI CLI وإنشاء مشروعك
الأول.
</Card>
### بناء طاقمك
<Card title="دليل البدء السريع" icon="rocket" href="/ar/quickstart">
اتبع دليل البدء السريع لإنشاء أول طاقم وكلاء باستخدام تهيئة
YAML.
</Card>
## الدعم والموارد
للدعم الخاص بالمؤسسات أو الأسئلة، تواصل مع فريق الدعم المخصص على [support@crewai.com](mailto:support@crewai.com).
<Card title="حجز عرض توضيحي" icon="calendar" href="mailto:support@crewai.com">
احجز وقتاً مع فريقنا لمعرفة المزيد عن ميزات Enterprise وكيف يمكنها
إفادة مؤسستك.
</Card>

View File

@@ -0,0 +1,39 @@
---
title: "تصدير OpenTelemetry"
description: "تصدير التتبعات والسجلات من عمليات نشر CrewAI AMP إلى مجمّع OpenTelemetry الخاص بك"
icon: "magnifying-glass-chart"
mode: "wide"
---
يمكن لـ CrewAI AMP تصدير **التتبعات** و**السجلات** من OpenTelemetry من عمليات النشر مباشرة إلى مجمّعك الخاص. يتيح لك ذلك مراقبة أداء الوكلاء وتتبع استدعاءات LLM وتصحيح الأخطاء باستخدام مجموعة المراقبة الحالية.
تتبع بيانات القياس [اتفاقيات OpenTelemetry GenAI الدلالية](https://opentelemetry.io/docs/specs/semconv/gen-ai/) بالإضافة إلى سمات خاصة بـ CrewAI.
## المتطلبات المسبقة
<CardGroup cols={2}>
<Card title="حساب CrewAI AMP" icon="users">
يجب أن يكون لدى مؤسستك حساب CrewAI AMP نشط.
</Card>
<Card title="مجمّع OpenTelemetry" icon="server">
تحتاج إلى نقطة نهاية مجمّع متوافقة مع OpenTelemetry (مثل OTel Collector الخاص بك أو Datadog أو Grafana أو أي واجهة خلفية متوافقة مع OTLP).
</Card>
</CardGroup>
## إعداد مجمّع
1. في CrewAI AMP، انتقل إلى **Settings** > **OpenTelemetry Collectors**.
2. انقر على **Add Collector**.
3. اختر نوع التكامل — **OpenTelemetry Traces** أو **OpenTelemetry Logs**.
4. هيّئ الاتصال:
- **Endpoint** — نقطة نهاية OTLP لمجمّعك (مثل `https://otel-collector.example.com:4317`).
- **Service Name** — اسم لتعريف هذه الخدمة في منصة المراقبة.
- **Custom Headers** *(اختياري)* — أضف رؤوس المصادقة أو التوجيه كأزواج مفتاح-قيمة.
- **Certificate** *(اختياري)* — قدم شهادة TLS إذا كان مجمّعك يتطلبها.
5. انقر على **Save**.
<Frame>![تهيئة مجمّع OpenTelemetry](/images/crewai-otel-collector-config.png)</Frame>
<Tip>
يمكنك إضافة مجمّعات متعددة — على سبيل المثال، واحد للتتبعات وآخر للسجلات، أو الإرسال إلى واجهات خلفية مختلفة لأغراض مختلفة.
</Tip>

View File

@@ -0,0 +1,136 @@
---
title: "خوادم MCP المخصصة"
description: "اربط خوادم MCP الخاصة بك بـ CrewAI AMP مع وصول عام أو مصادقة بمفتاح API أو OAuth 2.0"
icon: "plug"
mode: "wide"
---
يدعم CrewAI AMP الاتصال بأي خادم MCP يُنفّذ [Model Context Protocol](https://modelcontextprotocol.io/). يمكنك إحضار خوادم عامة لا تتطلب مصادقة، وخوادم محمية بمفتاح API أو رمز حامل، وخوادم تستخدم OAuth 2.0 للوصول المفوّض الآمن.
## المتطلبات المسبقة
<CardGroup cols={2}>
<Card title="حساب CrewAI AMP" icon="user">
تحتاج إلى حساب [CrewAI AMP](https://app.crewai.com) نشط.
</Card>
<Card title="رابط خادم MCP" icon="link">
رابط خادم MCP الذي تريد الاتصال به. يجب أن يكون الخادم متاحاً من الإنترنت ويدعم نقل Streamable HTTP.
</Card>
</CardGroup>
## إضافة خادم MCP مخصص
<Steps>
<Step title="فتح الأدوات والتكاملات">
انتقل إلى **Tools & Integrations** في الشريط الجانبي الأيسر لـ CrewAI AMP، ثم اختر علامة تبويب **Connections**.
</Step>
<Step title="بدء إضافة خادم MCP مخصص">
انقر على زر **Add Custom MCP Server**. سيظهر مربع حوار مع نموذج التهيئة.
</Step>
<Step title="ملء المعلومات الأساسية">
- **Name** (مطلوب): اسم وصفي لخادم MCP (مثل "My Internal Tools Server").
- **Description**: ملخص اختياري لما يقدمه خادم MCP هذا.
- **Server URL** (مطلوب): الرابط الكامل لنقطة نهاية خادم MCP (مثل `https://my-server.example.com/mcp`).
</Step>
<Step title="اختيار طريقة المصادقة">
اختر إحدى طرق المصادقة الثلاث المتاحة بناءً على كيفية تأمين خادم MCP. راجع الأقسام أدناه لتفاصيل كل طريقة.
</Step>
<Step title="إضافة رؤوس مخصصة (اختياري)">
إذا كان خادم MCP يتطلب رؤوساً إضافية في كل طلب (مثل معرّفات المستأجر أو رؤوس التوجيه)، انقر على **+ Add Header** وقدم اسم الرأس وقيمته. يمكنك إضافة رؤوس مخصصة متعددة.
</Step>
<Step title="إنشاء الاتصال">
انقر على **Create MCP Server** لحفظ الاتصال. سيظهر خادم MCP المخصص الآن في قائمة الاتصالات وستكون أدواته متاحة للاستخدام في طواقمك.
</Step>
</Steps>
## طرق المصادقة
### بدون مصادقة
اختر هذا الخيار عندما يكون خادم MCP متاحاً للجمهور ولا يتطلب أي بيانات اعتماد. هذا شائع للخوادم مفتوحة المصدر أو الخوادم الداخلية العاملة خلف VPN.
### رمز المصادقة
استخدم هذه الطريقة عندما يكون خادم MCP محمياً بمفتاح API أو رمز حامل.
<Frame>
<img src="/images/enterprise/custom-mcp-auth-token.png" alt="خادم MCP مخصص برمز مصادقة" />
</Frame>
| الحقل | مطلوب | الوصف |
|-------|-------|-------|
| **Header Name** | نعم | اسم رأس HTTP الذي يحمل الرمز (مثل `X-API-Key`، `Authorization`). |
| **Value** | نعم | مفتاح API أو رمز الحامل الخاص بك. |
| **Add to** | لا | أين يتم إرفاق بيانات الاعتماد — **Header** (افتراضي) أو **Query parameter**. |
<Tip>
إذا كان خادمك يتوقع رمز `Bearer` في رأس `Authorization`، عيّن Header Name إلى `Authorization` والقيمة إلى `Bearer <your-token>`.
</Tip>
### OAuth 2.0
استخدم هذه الطريقة لخوادم MCP التي تتطلب تفويض OAuth 2.0. سيتعامل CrewAI مع تدفق OAuth الكامل، بما في ذلك تحديث الرمز.
<Frame>
<img src="/images/enterprise/custom-mcp-oauth.png" alt="خادم MCP مخصص مع OAuth 2.0" />
</Frame>
| الحقل | مطلوب | الوصف |
|-------|-------|-------|
| **Redirect URI** | — | مُعبأ مسبقاً وللقراءة فقط. انسخ هذا الرابط وسجّله كرابط إعادة توجيه مصرّح به في مزود OAuth. |
| **Authorization Endpoint** | نعم | الرابط الذي يُوجَّه إليه المستخدمون لتفويض الوصول (مثل `https://auth.example.com/oauth/authorize`). |
| **Token Endpoint** | نعم | الرابط المستخدم لتبادل رمز التفويض برمز وصول (مثل `https://auth.example.com/oauth/token`). |
| **Client ID** | نعم | معرّف عميل OAuth الصادر من مزودك. |
| **Client Secret** | لا | سر عميل OAuth. غير مطلوب للعملاء العامين باستخدام PKCE. |
| **Scopes** | لا | قائمة نطاقات مفصولة بمسافات للطلب (مثل `read write`). |
| **Token Auth Method** | لا | كيفية إرسال بيانات اعتماد العميل عند تبادل الرموز — **Standard (POST body)** أو **Basic Auth (header)**. الافتراضي هو Standard. |
| **PKCE Supported** | لا | فعّل إذا كان مزود OAuth يدعم Proof Key for Code Exchange. موصى به لتحسين الأمان. |
<Info>
**اكتشاف تهيئة OAuth**: إذا كان مزود OAuth يدعم OpenID Connect Discovery، انقر على رابط **Discover OAuth Config** لملء نقاط نهاية التفويض والرمز تلقائياً من رابط `/.well-known/openid-configuration` الخاص بالمزود.
</Info>
#### إعداد OAuth 2.0 خطوة بخطوة
<Steps>
<Step title="تسجيل رابط إعادة التوجيه">
انسخ **Redirect URI** المعروض في النموذج وأضفه كرابط إعادة توجيه مصرّح به في إعدادات تطبيق مزود OAuth.
</Step>
<Step title="إدخال نقاط النهاية وبيانات الاعتماد">
املأ **Authorization Endpoint** و**Token Endpoint** و**Client ID**، واختيارياً **Client Secret** و**Scopes**.
</Step>
<Step title="تهيئة طريقة تبادل الرمز">
اختر **Token Auth Method** المناسبة. معظم المزودين يستخدمون الافتراضي **Standard (POST body)**. بعض المزودين القدامى يتطلبون **Basic Auth (header)**.
</Step>
<Step title="تفعيل PKCE (موصى به)">
حدد **PKCE Supported** إذا كان مزودك يدعمه. يضيف PKCE طبقة أمان إضافية لتدفق رمز التفويض وموصى به لجميع التكاملات الجديدة.
</Step>
<Step title="الإنشاء والتفويض">
انقر على **Create MCP Server**. سيتم توجيهك إلى مزود OAuth لتفويض الوصول. بمجرد التفويض، سيخزن CrewAI الرموز ويحدّثها تلقائياً حسب الحاجة.
</Step>
</Steps>
## استخدام خادم MCP المخصص
بمجرد الاتصال، تظهر أدوات خادم MCP المخصص جنباً إلى جنب مع الاتصالات المدمجة في صفحة **Tools & Integrations**. يمكنك:
- **تعيين الأدوات للوكلاء** في طواقمك تماماً كأي أداة CrewAI أخرى.
- **إدارة الرؤية** للتحكم في أعضاء الفريق الذين يمكنهم استخدام الخادم.
- **تعديل أو إزالة** الاتصال في أي وقت من قائمة الاتصالات.
<Warning>
إذا أصبح خادم MCP غير قابل للوصول أو انتهت صلاحية بيانات الاعتماد، ستفشل استدعاءات الأدوات التي تستخدم ذلك الخادم. تأكد من استقرار رابط الخادم وتحديث بيانات الاعتماد.
</Warning>
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للمساعدة في تهيئة خادم MCP المخصص أو استكشاف الأخطاء.
</Card>

View File

@@ -0,0 +1,445 @@
---
title: "النشر على AMP"
description: "انشر طاقمك أو تدفقك على CrewAI AMP"
icon: "rocket"
mode: "wide"
---
<Note>
بعد إنشاء طاقم أو تدفق محلياً (أو عبر Crew Studio)، الخطوة التالية هي
نشره على منصة CrewAI AMP. يغطي هذا الدليل طرق نشر متعددة
لمساعدتك في اختيار النهج الأفضل لسير عملك.
</Note>
## المتطلبات المسبقة
<CardGroup cols={2}>
<Card title="مشروع جاهز للنشر" icon="check-circle">
يجب أن يكون لديك طاقم أو تدفق يعمل بنجاح محلياً.
اتبع [دليل التحضير](/ar/enterprise/guides/prepare-for-deployment) للتحقق من بنية مشروعك.
</Card>
<Card title="مستودع GitHub" icon="github">
يجب أن يكون الكود في مستودع GitHub (لطريقة تكامل
GitHub)
</Card>
</CardGroup>
<Info>
**الطواقم مقابل التدفقات**: يمكن نشر كلا نوعي المشاريع كـ "أتمتات" على CrewAI AMP.
عملية النشر هي نفسها، لكن لهما بنى مشاريع مختلفة.
راجع [التحضير للنشر](/ar/enterprise/guides/prepare-for-deployment) للتفاصيل.
</Info>
## الخيار 1: النشر باستخدام CrewAI CLI
يوفر CLI أسرع طريقة لنشر الطواقم أو التدفقات المطورة محلياً على منصة AMP.
يكتشف CLI تلقائياً نوع مشروعك من `pyproject.toml` ويبني وفقاً لذلك.
<Steps>
<Step title="تثبيت CrewAI CLI">
إذا لم تكن قد فعلت بالفعل، ثبّت CrewAI CLI:
```bash
pip install crewai[tools]
```
<Tip>
يأتي CLI مع حزمة CrewAI الرئيسية، لكن الإضافة `[tools]` تضمن حصولك على جميع اعتماديات النشر.
</Tip>
</Step>
<Step title="المصادقة مع منصة Enterprise">
أولاً، تحتاج لمصادقة CLI مع منصة CrewAI AMP:
```bash
# إذا كان لديك حساب CrewAI AMP بالفعل، أو تريد إنشاء واحد:
crewai login
```
عند تشغيل أي من الأمرين، سيقوم CLI بـ:
1. عرض رابط ورمز جهاز فريد
2. فتح متصفحك على صفحة المصادقة
3. طلب تأكيد الجهاز
4. إتمام عملية المصادقة
عند المصادقة الناجحة، سترى رسالة تأكيد في الطرفية!
</Step>
<Step title="إنشاء عملية نشر">
من مجلد مشروعك، شغّل:
```bash
crewai deploy create
```
سيقوم هذا الأمر بـ:
1. اكتشاف معلومات مستودع GitHub
2. تحديد متغيرات البيئة في ملف `.env` المحلي
3. نقل هذه المتغيرات بأمان إلى منصة Enterprise
4. إنشاء عملية نشر جديدة بمعرّف فريد
عند الإنشاء الناجح، سترى رسالة مثل:
```shell
Deployment created successfully!
Name: your_project_name
Deployment ID: 01234567-89ab-cdef-0123-456789abcdef
Current Status: Deploy Enqueued
```
</Step>
<Step title="مراقبة تقدم النشر">
تتبع حالة النشر بـ:
```bash
crewai deploy status
```
للسجلات المفصلة لعملية البناء:
```bash
crewai deploy logs
```
<Tip>
يستغرق النشر الأول عادة 10-15 دقيقة لبناء صور الحاويات. عمليات النشر اللاحقة أسرع بكثير.
</Tip>
</Step>
</Steps>
## أوامر CLI إضافية
يقدم CrewAI CLI عدة أوامر لإدارة عمليات النشر:
```bash
# عرض جميع عمليات النشر
crewai deploy list
# الحصول على حالة النشر
crewai deploy status
# عرض سجلات النشر
crewai deploy logs
# دفع التحديثات بعد تغييرات الكود
crewai deploy push
# إزالة عملية نشر
crewai deploy remove <deployment_id>
```
## الخيار 2: النشر مباشرة عبر واجهة الويب
يمكنك أيضاً نشر طواقمك أو تدفقاتك مباشرة عبر واجهة ويب CrewAI AMP بربط حساب GitHub. لا يتطلب هذا النهج استخدام CLI على جهازك المحلي. تكتشف المنصة تلقائياً نوع مشروعك وتتعامل مع البناء بشكل مناسب.
<Steps>
<Step title="الدفع إلى GitHub">
تحتاج لدفع طاقمك إلى مستودع GitHub. إذا لم تكن قد أنشأت طاقماً بعد، يمكنك [اتباع هذا الدليل](/ar/quickstart).
</Step>
<Step title="ربط GitHub بـ CrewAI AMP">
1. سجّل الدخول إلى [CrewAI AMP](https://app.crewai.com)
2. انقر على زر "Connect GitHub"
<Frame>
![زر ربط GitHub](/images/enterprise/connect-github.png)
</Frame>
</Step>
<Step title="اختيار المستودع">
بعد ربط حساب GitHub، ستتمكن من اختيار المستودع للنشر:
<Frame>
![اختيار المستودع](/images/enterprise/select-repo.png)
</Frame>
</Step>
<Step title="تعيين متغيرات البيئة">
قبل النشر، ستحتاج لإعداد متغيرات البيئة للاتصال بمزود LLM أو خدمات أخرى:
1. يمكنك إضافة المتغيرات فردياً أو بشكل جماعي
2. أدخل متغيرات البيئة بتنسيق `KEY=VALUE` (واحد لكل سطر)
<Frame>
![تعيين متغيرات البيئة](/images/enterprise/set-env-variables.png)
</Frame>
<Info>
تستخدم حزم Python خاصة؟ ستحتاج لإضافة بيانات اعتماد السجل هنا أيضاً.
راجع [سجلات الحزم الخاصة](/ar/enterprise/guides/private-package-registry) للمتغيرات المطلوبة.
</Info>
</Step>
<Step title="نشر طاقمك">
1. انقر على زر "Deploy" لبدء عملية النشر
2. يمكنك مراقبة التقدم عبر شريط التقدم
3. يستغرق النشر الأول عادة حوالي 10-15 دقيقة؛ عمليات النشر اللاحقة ستكون أسرع
<Frame>
![تقدم النشر](/images/enterprise/deploy-progress.png)
</Frame>
بمجرد اكتمال النشر، سترى:
- رابط طاقمك الفريد
- رمز Bearer لحماية API طاقمك
- زر "Delete" إذا كنت تحتاج لإزالة النشر
</Step>
</Steps>
## الخيار 3: إعادة النشر باستخدام API (تكامل CI/CD)
لعمليات النشر الآلية في خطوط أنابيب CI/CD، يمكنك استخدام CrewAI API لتشغيل إعادة نشر الطواقم الحالية. هذا مفيد بشكل خاص لـ GitHub Actions وJenkins أو سير عمل الأتمتة الأخرى.
<Steps>
<Step title="الحصول على رمز الوصول الشخصي">
انتقل إلى إعدادات حساب CrewAI AMP لإنشاء رمز API:
1. انتقل إلى [app.crewai.com](https://app.crewai.com)
2. انقر على **Settings** → **Account** → **Personal Access Token**
3. أنشئ رمزاً جديداً وانسخه بأمان
4. خزّن هذا الرمز كسر في نظام CI/CD
</Step>
<Step title="إيجاد UUID الأتمتة">
حدد موقع المعرّف الفريد لطاقمك المنشور:
1. انتقل إلى **Automations** في لوحة تحكم CrewAI AMP
2. اختر الأتمتة/الطاقم الحالي
3. انقر على **Additional Details**
4. انسخ **UUID** — يحدد هذا نشر طاقمك المحدد
</Step>
<Step title="تشغيل إعادة النشر عبر API">
استخدم نقطة نهاية Deploy API لتشغيل إعادة النشر:
```bash
curl -i -X POST \
-H "Authorization: Bearer YOUR_PERSONAL_ACCESS_TOKEN" \
https://app.crewai.com/crewai_plus/api/v1/crews/YOUR-AUTOMATION-UUID/deploy
# HTTP/2 200
# content-type: application/json
#
# {
# "uuid": "your-automation-uuid",
# "status": "Deploy Enqueued",
# "public_url": "https://your-crew-deployment.crewai.com",
# "token": "your-bearer-token"
# }
```
<Info>
إذا تم إنشاء أتمتتك متصلة بـ Git أولاً، سيسحب API تلقائياً أحدث التغييرات من مستودعك قبل إعادة النشر.
</Info>
</Step>
<Step title="مثال تكامل GitHub Actions">
إليك سير عمل GitHub Actions مع مشغلات نشر أكثر تعقيداً:
```yaml
name: Deploy CrewAI Automation
on:
push:
branches: [ main ]
pull_request:
types: [ labeled ]
release:
types: [ published ]
jobs:
deploy:
runs-on: ubuntu-latest
if: |
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'deploy')) ||
(github.event_name == 'release')
steps:
- name: Trigger CrewAI Redeployment
run: |
curl -X POST \
-H "Authorization: Bearer ${{ secrets.CREWAI_PAT }}" \
https://app.crewai.com/crewai_plus/api/v1/crews/${{ secrets.CREWAI_AUTOMATION_UUID }}/deploy
```
<Tip>
أضف `CREWAI_PAT` و`CREWAI_AUTOMATION_UUID` كأسرار مستودع. لعمليات نشر PR، أضف تسمية "deploy" لتشغيل سير العمل.
</Tip>
</Step>
</Steps>
## التفاعل مع أتمتتك المنشورة
بمجرد اكتمال النشر، يمكنك الوصول إلى طاقمك عبر:
1. **REST API**: تنشئ المنصة نقطة نهاية HTTPS فريدة بهذه المسارات الرئيسية:
- `/inputs`: يعرض معاملات الإدخال المطلوبة
- `/kickoff`: يبدأ التنفيذ بالمدخلات المقدمة
- `/status/{kickoff_id}`: يتحقق من حالة التنفيذ
2. **واجهة الويب**: زر [app.crewai.com](https://app.crewai.com) للوصول إلى:
- **علامة تبويب Status**: عرض معلومات النشر وتفاصيل نقطة نهاية API ورمز المصادقة
- **علامة تبويب Run**: تمثيل مرئي لبنية طاقمك
- **علامة تبويب Executions**: سجل جميع عمليات التنفيذ
- **علامة تبويب Metrics**: تحليلات الأداء
- **علامة تبويب Traces**: رؤى التنفيذ المفصلة
### تشغيل عملية تنفيذ
من لوحة تحكم Enterprise، يمكنك:
1. النقر على اسم طاقمك لفتح تفاصيله
2. اختيار "Trigger Crew" من واجهة الإدارة
3. إدخال المدخلات المطلوبة في النافذة المنبثقة
4. مراقبة التقدم أثناء مرور التنفيذ عبر خط الأنابيب
### المراقبة والتحليلات
توفر منصة Enterprise ميزات مراقبة شاملة:
- **إدارة التنفيذ**: تتبع عمليات التشغيل النشطة والمكتملة
- **التتبعات**: تحليلات مفصلة لكل عملية تنفيذ
- **المقاييس**: استخدام الرموز وأوقات التنفيذ والتكاليف
- **عرض الجدول الزمني**: تمثيل مرئي لتسلسل المهام
### ميزات متقدمة
تقدم منصة Enterprise أيضاً:
- **إدارة متغيرات البيئة**: تخزين وإدارة مفاتيح API بأمان
- **اتصالات LLM**: تهيئة التكاملات مع مزودي LLM المختلفين
- **مستودع الأدوات المخصصة**: إنشاء ومشاركة وتثبيت الأدوات
- **Crew Studio**: بناء الطواقم عبر واجهة محادثة دون كتابة كود
## استكشاف أخطاء النشر وإصلاحها
إذا فشل النشر، تحقق من هذه المشكلات الشائعة:
### فشل البناء
#### ملف uv.lock مفقود
**العرض**: فشل البناء مبكراً مع أخطاء حل الاعتماديات
**الحل**: أنشئ ملف القفل وارفعه:
```bash
uv lock
git add uv.lock
git commit -m "Add uv.lock for deployment"
git push
```
<Warning>
ملف `uv.lock` مطلوب لجميع عمليات النشر. بدونه، لا يمكن للمنصة
تثبيت اعتمادياتك بشكل موثوق.
</Warning>
#### بنية المشروع الخاطئة
**العرض**: أخطاء "Could not find entry point" أو "Module not found"
**الحل**: تحقق من أن مشروعك يتطابق مع البنية المتوقعة:
- **كل من الطواقم والتدفقات**: يجب أن تكون نقطة الدخول في `src/project_name/main.py`
- **الطواقم**: تستخدم دالة `run()` كنقطة دخول
- **التدفقات**: تستخدم دالة `kickoff()` كنقطة دخول
راجع [التحضير للنشر](/ar/enterprise/guides/prepare-for-deployment) لمخططات البنية المفصلة.
#### مُزخرف CrewBase مفقود
**العرض**: أخطاء "Crew not found" أو "Config not found" أو أخطاء تهيئة الوكيل/المهمة
**الحل**: تأكد من أن **جميع** فئات الطاقم تستخدم مُزخرف `@CrewBase`:
```python
from crewai.project import CrewBase, agent, crew, task
@CrewBase # This decorator is REQUIRED
class YourCrew():
"""Your crew description"""
@agent
def my_agent(self) -> Agent:
return Agent(
config=self.agents_config['my_agent'], # type: ignore[index]
verbose=True
)
# ... rest of crew definition
```
<Info>
ينطبق هذا على الطواقم المستقلة والطواقم المضمنة داخل مشاريع التدفق.
كل فئة طاقم تحتاج المُزخرف.
</Info>
#### نوع pyproject.toml غير صحيح
**العرض**: نجاح البناء لكن فشل وقت التشغيل، أو سلوك غير متوقع
**الحل**: تحقق من أن قسم `[tool.crewai]` يتطابق مع نوع مشروعك:
```toml
# For Crew projects:
[tool.crewai]
type = "crew"
# For Flow projects:
[tool.crewai]
type = "flow"
```
### فشل وقت التشغيل
#### فشل اتصال LLM
**العرض**: أخطاء مفتاح API، "model not found"، أو فشل المصادقة
**الحل**:
1. تحقق من صحة تعيين مفتاح API لمزود LLM في متغيرات البيئة
2. تأكد من تطابق أسماء متغيرات البيئة مع ما يتوقعه الكود
3. اختبر محلياً بنفس متغيرات البيئة بالضبط قبل النشر
#### أخطاء تنفيذ الطاقم
**العرض**: يبدأ الطاقم لكن يفشل أثناء التنفيذ
**الحل**:
1. تحقق من سجلات التنفيذ في لوحة تحكم AMP (علامة تبويب Traces)
2. تحقق من أن جميع الأدوات لديها مفاتيح API المطلوبة مُهيأة
3. تأكد من صحة تهيئات الوكلاء في `agents.yaml`
4. تحقق من تهيئات المهام في `tasks.yaml` بحثاً عن أخطاء الصياغة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للمساعدة في مشاكل النشر أو أسئلة حول
منصة AMP.
</Card>

View File

@@ -0,0 +1,182 @@
---
title: "تفعيل Crew Studio"
description: "تفعيل Crew Studio على CrewAI AMP"
icon: "comments"
mode: "wide"
---
<Tip>
Crew Studio هو أداة قوية **بدون كود/منخفضة الكود** تتيح لك بسرعة
بناء أو هيكلة الطواقم عبر واجهة محادثة.
</Tip>
## ما هو Crew Studio؟
Crew Studio هو طريقة مبتكرة لإنشاء طواقم وكلاء الذكاء الاصطناعي بدون كتابة كود.
<Frame>
![واجهة Crew Studio](/images/enterprise/crew-studio-interface.png)
</Frame>
مع Crew Studio، يمكنك:
- الدردشة مع مساعد الطاقم لوصف مشكلتك
- إنشاء الوكلاء والمهام تلقائياً
- اختيار الأدوات المناسبة
- تهيئة المدخلات الضرورية
- إنشاء كود قابل للتنزيل للتخصيص
- النشر مباشرة على منصة CrewAI AMP
## خطوات التهيئة
قبل البدء باستخدام Crew Studio، تحتاج لتهيئة اتصالات LLM:
<Steps>
<Step title="إعداد اتصال LLM">
انتقل إلى علامة تبويب **LLM Connections** في لوحة تحكم CrewAI AMP وأنشئ اتصال LLM جديداً.
<Note>
يمكنك استخدام أي مزود LLM تريده ويدعمه CrewAI.
</Note>
هيّئ اتصال LLM:
- أدخل `Connection Name` (مثل `OpenAI`)
- اختر مزود النموذج: `openai` أو `azure`
- اختر النماذج التي تريد استخدامها في طواقم Studio
- نوصي بـ `gpt-4o` و`o1-mini` و`gpt-4o-mini` على الأقل
- أضف مفتاح API كمتغير بيئة:
- لـ OpenAI: أضف `OPENAI_API_KEY` مع مفتاح API
- لـ Azure OpenAI: راجع [هذه المقالة](https://blog.crewai.com/configuring-azure-openai-with-crewai-a-comprehensive-guide/) لتفاصيل التهيئة
- انقر على `Add Connection` لحفظ التهيئة
<Frame>
![تهيئة اتصال LLM](/images/enterprise/llm-connection-config.png)
</Frame>
</Step>
<Step title="التحقق من إضافة الاتصال">
بمجرد إتمام الإعداد، سترى الاتصال الجديد مُضافاً إلى قائمة الاتصالات المتاحة.
<Frame>
![تم إضافة الاتصال](/images/enterprise/connection-added.png)
</Frame>
</Step>
<Step title="تهيئة إعدادات LLM الافتراضية">
في القائمة الرئيسية، انتقل إلى **Settings → Defaults** وهيّئ إعدادات LLM الافتراضية:
- اختر النماذج الافتراضية للوكلاء والمكونات الأخرى
- عيّن التهيئات الافتراضية لـ Crew Studio
انقر على `Save Settings` لتطبيق تغييراتك.
<Frame>
![تهيئة إعدادات LLM الافتراضية](/images/enterprise/llm-defaults.png)
</Frame>
</Step>
</Steps>
## استخدام Crew Studio
الآن بعد تهيئة اتصال LLM والإعدادات الافتراضية، أنت جاهز لبدء استخدام Crew Studio!
<Steps>
<Step title="الوصول إلى Studio">
انتقل إلى قسم **Studio** في لوحة تحكم CrewAI AMP.
</Step>
<Step title="بدء محادثة">
ابدأ محادثة مع مساعد الطاقم بوصف المشكلة التي تريد حلها:
```md
I need a crew that can research the latest AI developments and create a summary report.
```
سيطرح مساعد الطاقم أسئلة توضيحية لفهم متطلباتك بشكل أفضل.
</Step>
<Step title="مراجعة الطاقم المُنشأ">
راجع تهيئة الطاقم المُنشأ، بما في ذلك:
- الوكلاء وأدوارهم
- المهام المطلوب تنفيذها
- المدخلات المطلوبة
- الأدوات المستخدمة
هذه فرصتك لتنقيح التهيئة قبل المتابعة.
</Step>
<Step title="النشر أو التنزيل">
بمجرد رضاك عن التهيئة، يمكنك:
- تنزيل الكود المُنشأ للتخصيص المحلي
- نشر الطاقم مباشرة على منصة CrewAI AMP
- تعديل التهيئة وإعادة إنشاء الطاقم
</Step>
<Step title="اختبار طاقمك">
بعد النشر، اختبر طاقمك بمدخلات نموذجية للتأكد من أنه يعمل كما هو متوقع.
</Step>
</Steps>
<Tip>
للحصول على أفضل النتائج، قدم أوصافاً واضحة ومفصلة لما تريد أن
يحققه طاقمك. ضمّن مدخلات ومخرجات محددة متوقعة في
وصفك.
</Tip>
## مثال على سير العمل
إليك سير عمل نموذجي لإنشاء طاقم مع Crew Studio:
<Steps>
<Step title="وصف مشكلتك">
ابدأ بوصف مشكلتك:
```md
I need a crew that can analyze financial news and provide investment recommendations
```
</Step>
{" "}
<Step title="الإجابة على الأسئلة">
أجب على أسئلة التوضيح من مساعد الطاقم لتنقيح
متطلباتك.
</Step>
<Step title="مراجعة الخطة">
راجع خطة الطاقم المُنشأة، التي قد تتضمن:
- وكيل بحث لجمع الأخبار المالية
- وكيل تحليل لتفسير البيانات
- وكيل توصيات لتقديم نصائح استثمارية
</Step>
{" "}
<Step title="الموافقة أو التعديل">
وافق على الخطة أو اطلب تغييرات إذا لزم الأمر.
</Step>
{" "}
<Step title="التنزيل أو النشر">
نزّل الكود للتخصيص أو انشر مباشرة على المنصة.
</Step>
<Step title="الاختبار والتنقيح">
اختبر طاقمك بمدخلات نموذجية ونقّح حسب الحاجة.
</Step>
</Steps>
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للمساعدة في Crew Studio أو أي ميزات أخرى في CrewAI
AMP.
</Card>

View File

@@ -0,0 +1,97 @@
---
title: "مشغل Gmail"
description: "تشغيل الأتمتات عند حدوث أحداث Gmail (مثل رسائل بريد إلكتروني جديدة، تسميات)."
icon: "envelope"
mode: "wide"
---
## نظرة عامة
استخدم مشغل Gmail لتشغيل طواقمك المنشورة عند حدوث أحداث Gmail في الحسابات المتصلة، مثل استلام رسالة بريد إلكتروني جديدة أو رسائل تطابق تسمية/فلتر.
<Tip>
تأكد من ربط Gmail في Tools & Integrations وتفعيل المشغل
لعملية النشر.
</Tip>
## تفعيل مشغل Gmail
1. افتح عملية النشر في CrewAI AMP
2. انتقل إلى علامة تبويب **Triggers**
3. حدد موقع **Gmail** وبدّل مفتاح التبديل للتفعيل
<Frame>
<img
src="/images/enterprise/trigger-selected.png"
alt="تفعيل أو تعطيل المشغلات بالتبديل"
/>
</Frame>
## مثال: معالجة الرسائل الجديدة
عند وصول رسالة بريد إلكتروني جديدة، سيرسل مشغل Gmail الحمولة إلى طاقمك أو تدفقك. فيما يلي مثال على طاقم يحلل ويعالج حمولة المشغل.
```python
@CrewBase
class GmailProcessingCrew:
@agent
def parser(self) -> Agent:
return Agent(
config=self.agents_config['parser'],
)
@task
def parse_gmail_payload(self) -> Task:
return Task(
config=self.tasks_config['parse_gmail_payload'],
agent=self.parser(),
)
@task
def act_on_email(self) -> Task:
return Task(
config=self.tasks_config['act_on_email'],
agent=self.parser(),
)
```
ستكون حمولة Gmail متاحة عبر آليات السياق القياسية.
### الاختبار المحلي
اختبر تكامل مشغل Gmail محلياً باستخدام CrewAI CLI:
```bash
# عرض جميع المشغلات المتاحة
crewai triggers list
# محاكاة مشغل Gmail بحمولة واقعية
crewai triggers run gmail/new_email_received
```
سينفذ أمر `crewai triggers run` طاقمك بحمولة Gmail كاملة، مما يتيح لك اختبار منطق التحليل قبل النشر.
<Warning>
استخدم `crewai triggers run gmail/new_email_received` (وليس `crewai run`) لمحاكاة
تنفيذ المشغل أثناء التطوير. بعد النشر، سيتلقى طاقمك
حمولة المشغل تلقائياً.
</Warning>
## مراقبة عمليات التنفيذ
تتبع سجل وأداء عمليات التشغيل المُشغّلة:
<Frame>
<img
src="/images/enterprise/list-executions.png"
alt="قائمة عمليات التنفيذ المُشغّلة بواسطة الأتمتة"
/>
</Frame>
## استكشاف الأخطاء وإصلاحها
- تأكد من ربط Gmail في Tools & Integrations
- تحقق من تفعيل مشغل Gmail في علامة تبويب Triggers
- اختبر محلياً بـ `crewai triggers run gmail/new_email_received` لرؤية هيكل الحمولة بالضبط
- تحقق من سجلات التنفيذ وتأكد من تمرير الحمولة كـ `crewai_trigger_payload`
- تذكر: استخدم `crewai triggers run` (وليس `crewai run`) لمحاكاة تنفيذ المشغل

View File

@@ -0,0 +1,83 @@
---
title: "مشغل Google Calendar"
description: "تشغيل الطواقم عند إنشاء أو تحديث أو إلغاء أحداث Google Calendar"
icon: "calendar"
mode: "wide"
---
## نظرة عامة
استخدم مشغل Google Calendar لإطلاق الأتمتات كلما تغيرت أحداث التقويم. تشمل حالات الاستخدام الشائعة إحاطة الفريق قبل اجتماع، وإخطار أصحاب المصلحة عند إلغاء حدث هام، أو تلخيص الجداول اليومية.
<Tip>
تأكد من ربط Google Calendar في **Tools & Integrations** وتفعيله
لعملية النشر التي تريد أتمتتها.
</Tip>
## تفعيل مشغل Google Calendar
1. افتح عملية النشر في CrewAI AMP
2. انتقل إلى علامة تبويب **Triggers**
3. حدد موقع **Google Calendar** وبدّل مفتاح التبديل للتفعيل
<Frame>
<img
src="/images/enterprise/calendar-trigger.png"
alt="تفعيل أو تعطيل المشغلات بالتبديل"
/>
</Frame>
## مثال: تلخيص تفاصيل الاجتماع
المقتطف أدناه يعكس مثال `calendar-event-crew.py` في مستودع المشغلات. يحلل الحمولة، ويحلل الحاضرين والتوقيت، وينتج ملخصاً للاجتماع للأدوات اللاحقة.
```python
from calendar_event_crew import GoogleCalendarEventTrigger
crew = GoogleCalendarEventTrigger().crew()
result = crew.kickoff({
"crewai_trigger_payload": calendar_payload,
})
print(result.raw)
```
استخدم `crewai_trigger_payload` تماماً كما يتم تسليمه من المشغل حتى يتمكن الطاقم من استخراج الحقول المناسبة.
## الاختبار المحلي
اختبر تكامل مشغل Google Calendar محلياً باستخدام CrewAI CLI:
```bash
# عرض جميع المشغلات المتاحة
crewai triggers list
# محاكاة مشغل Google Calendar بحمولة واقعية
crewai triggers run google_calendar/event_changed
```
سينفذ أمر `crewai triggers run` طاقمك بحمولة Calendar كاملة، مما يتيح لك اختبار منطق التحليل قبل النشر.
<Warning>
استخدم `crewai triggers run google_calendar/event_changed` (وليس `crewai run`) لمحاكاة
تنفيذ المشغل أثناء التطوير. بعد النشر، سيتلقى طاقمك
حمولة المشغل تلقائياً.
</Warning>
## مراقبة عمليات التنفيذ
تتبع قائمة **Executions** في لوحة تحكم النشر كل عملية تشغيل مُشغّلة وتعرض بيانات الحمولة الوصفية وملخصات المخرجات والأخطاء.
<Frame>
<img
src="/images/enterprise/list-executions.png"
alt="قائمة عمليات التنفيذ المُشغّلة بواسطة الأتمتة"
/>
</Frame>
## استكشاف الأخطاء وإصلاحها
- تأكد من ربط حساب Google الصحيح وتفعيل المشغل
- اختبر محلياً بـ `crewai triggers run google_calendar/event_changed` لرؤية هيكل الحمولة بالضبط
- تأكد من أن سير عملك يتعامل مع أحداث اليوم الكامل (الحمولات تستخدم `start.date` و`end.date` بدلاً من الطوابع الزمنية)
- تحقق من سجلات التنفيذ إذا كانت التذكيرات أو مصفوفات الحاضرين مفقودة — قد تحد صلاحيات التقويم من الحقول في الحمولة
- تذكر: استخدم `crewai triggers run` (وليس `crewai run`) لمحاكاة تنفيذ المشغل

View File

@@ -0,0 +1,80 @@
---
title: "مشغل Google Drive"
description: "الاستجابة لأحداث ملفات Google Drive بطواقم آلية"
icon: "folder"
mode: "wide"
---
## نظرة عامة
شغّل أتمتاتك عند إنشاء أو تحديث أو حذف ملفات في Google Drive. تشمل سير العمل النموذجية تلخيص المحتوى المُحمّل حديثاً، وتطبيق سياسات المشاركة، أو إخطار المالكين عند تغيير ملفات هامة.
<Tip>
اربط Google Drive في **Tools & Integrations** وتأكد من تفعيل المشغل
للأتمتة التي تريد مراقبتها.
</Tip>
## تفعيل مشغل Google Drive
1. افتح عملية النشر في CrewAI AMP
2. انتقل إلى علامة تبويب **Triggers**
3. حدد موقع **Google Drive** وبدّل مفتاح التبديل للتفعيل
<Frame>
<img
src="/images/enterprise/gdrive-trigger.png"
alt="تفعيل أو تعطيل المشغلات بالتبديل"
/>
</Frame>
## مثال: تلخيص نشاط الملفات
تحلل طواقم Drive النموذجية الحمولة لاستخراج بيانات الملف الوصفية وتقييم الصلاحيات ونشر ملخص.
```python
from drive_file_crew import GoogleDriveFileTrigger
crew = GoogleDriveFileTrigger().crew()
crew.kickoff({
"crewai_trigger_payload": drive_payload,
})
```
## الاختبار المحلي
اختبر تكامل مشغل Google Drive محلياً باستخدام CrewAI CLI:
```bash
# عرض جميع المشغلات المتاحة
crewai triggers list
# محاكاة مشغل Google Drive بحمولة واقعية
crewai triggers run google_drive/file_changed
```
سينفذ أمر `crewai triggers run` طاقمك بحمولة Drive كاملة، مما يتيح لك اختبار منطق التحليل قبل النشر.
<Warning>
استخدم `crewai triggers run google_drive/file_changed` (وليس `crewai run`) لمحاكاة
تنفيذ المشغل أثناء التطوير. بعد النشر، سيتلقى طاقمك
حمولة المشغل تلقائياً.
</Warning>
## مراقبة عمليات التنفيذ
تتبع سجل وأداء عمليات التشغيل المُشغّلة عبر قائمة **Executions** في لوحة تحكم النشر.
<Frame>
<img
src="/images/enterprise/list-executions.png"
alt="قائمة عمليات التنفيذ المُشغّلة بواسطة الأتمتة"
/>
</Frame>
## استكشاف الأخطاء وإصلاحها
- تحقق من ربط Google Drive وتفعيل مفتاح التبديل للمشغل
- اختبر محلياً بـ `crewai triggers run google_drive/file_changed` لرؤية هيكل الحمولة بالضبط
- إذا كانت الحمولة تفتقد بيانات الصلاحيات، تأكد من أن الحساب المتصل لديه صلاحية الوصول إلى الملف أو المجلد
- يرسل المشغل معرّفات الملفات فقط؛ استخدم Drive API إذا كنت تحتاج جلب المحتوى الثنائي أثناء تشغيل الطاقم
- تذكر: استخدم `crewai triggers run` (وليس `crewai run`) لمحاكاة تنفيذ المشغل

View File

@@ -0,0 +1,61 @@
---
title: "مشغل HubSpot"
description: "تشغيل طواقم CrewAI مباشرة من سير عمل HubSpot"
icon: "hubspot"
mode: "wide"
---
يقدم هذا الدليل عملية خطوة بخطوة لإعداد مشغلات HubSpot لـ CrewAI AMP، مما يتيح لك بدء الطواقم مباشرة من سير عمل HubSpot.
## المتطلبات المسبقة
- حساب CrewAI AMP
- حساب HubSpot مع ميزة [HubSpot Workflows](https://knowledge.hubspot.com/workflows/create-workflows)
## خطوات الإعداد
<Steps>
<Step title="ربط حساب HubSpot بـ CrewAI AMP">
- سجّل الدخول إلى `حساب CrewAI AMP > Triggers` - اختر `HubSpot` من
قائمة المشغلات المتاحة - اختر حساب HubSpot الذي تريد ربطه
بـ CrewAI AMP - اتبع التعليمات على الشاشة لتفويض وصول CrewAI AMP
إلى حساب HubSpot - ستظهر رسالة تأكيد بمجرد
ربط HubSpot بنجاح مع CrewAI AMP
</Step>
<Step title="إنشاء سير عمل HubSpot">
- سجّل الدخول إلى `حساب HubSpot > Automations > Workflows > New workflow`
- اختر نوع سير العمل المناسب لاحتياجاتك (مثل Start from scratch) -
في منشئ سير العمل، انقر على أيقونة Plus (+) لإضافة إجراء جديد. -
اختر `Integrated apps > CrewAI > Kickoff a Crew`. - اختر الطاقم الذي
تريد تشغيله. - انقر على `Save` لإضافة الإجراء إلى سير عملك
<Frame>
<img
src="/images/enterprise/hubspot-workflow-1.png"
alt="سير عمل HubSpot 1"
/>
</Frame>
</Step>
<Step title="استخدام نتائج الطاقم مع إجراءات أخرى">
- بعد خطوة Kickoff a Crew، انقر على أيقونة Plus (+) لإضافة
إجراء جديد. - على سبيل المثال، لإرسال إشعار بريد إلكتروني داخلي، اختر
`Communications > Send internal email notification` - في حقل Body،
انقر على `Insert data`، اختر `View properties or action outputs from > Action
outputs > Crew Result` لتضمين بيانات الطاقم في البريد الإلكتروني
<Frame>
<img
src="/images/enterprise/hubspot-workflow-2.png"
alt="سير عمل HubSpot 2"
/>
</Frame>
- هيّئ أي إجراءات إضافية حسب الحاجة - راجع خطوات
سير عملك للتأكد من إعداد كل شيء بشكل صحيح - فعّل سير العمل
<Frame>
<img
src="/images/enterprise/hubspot-workflow-3.png"
alt="سير عمل HubSpot 3"
/>
</Frame>
</Step>
</Steps>
لمزيد من المعلومات المفصلة حول الإجراءات المتاحة وخيارات التخصيص، راجع [وثائق HubSpot Workflows](https://knowledge.hubspot.com/workflows/create-workflows).

View File

@@ -0,0 +1,157 @@
---
title: "سير عمل HITL"
description: "تعلم كيفية تنفيذ سير عمل Human-In-The-Loop في CrewAI لتعزيز اتخاذ القرار"
icon: "user-check"
mode: "wide"
---
Human-In-The-Loop (HITL) هو نهج قوي يجمع بين الذكاء الاصطناعي والخبرة البشرية لتعزيز اتخاذ القرار وتحسين نتائج المهام. يوضح هذا الدليل كيفية تنفيذ HITL داخل CrewAI Enterprise.
## نهجا HITL في CrewAI
يقدم CrewAI نهجين لتنفيذ سير عمل Human-In-The-Loop:
| النهج | الأفضل لـ | الإصدار |
|-------|-----------|---------|
| **قائم على التدفق** (مُزخرف `@human_feedback`) | الإنتاج مع واجهة Enterprise، سير عمل البريد الإلكتروني أولاً، ميزات المنصة الكاملة | **1.8.0+** |
| **قائم على Webhook** | التكاملات المخصصة، الأنظمة الخارجية (Slack، Teams، إلخ.)، الإعدادات القديمة | جميع الإصدارات |
## HITL القائم على التدفق مع منصة Enterprise
<Note>
يتطلب مُزخرف `@human_feedback` **إصدار CrewAI 1.8.0 أو أعلى**.
</Note>
عند استخدام مُزخرف `@human_feedback` في تدفقاتك، يوفر CrewAI Enterprise **نظام HITL يعتمد على البريد الإلكتروني أولاً** يمكّن أي شخص لديه عنوان بريد إلكتروني من الاستجابة لطلبات المراجعة:
<CardGroup cols={2}>
<Card title="تصميم البريد الإلكتروني أولاً" icon="envelope">
يتلقى المستجيبون إشعارات بريد إلكتروني ويمكنهم الرد مباشرة — لا حاجة لتسجيل الدخول.
</Card>
<Card title="مراجعة من لوحة التحكم" icon="desktop">
راجع واستجب لطلبات HITL في لوحة تحكم Enterprise عند التفضيل.
</Card>
<Card title="توجيه مرن" icon="route">
وجّه الطلبات إلى عناوين بريد محددة بناءً على أنماط الدوال أو استخراجها من حالة التدفق.
</Card>
<Card title="استجابة تلقائية" icon="clock">
هيّئ استجابات احتياطية تلقائية عندما لا يرد أي شخص خلال المهلة الزمنية.
</Card>
</CardGroup>
### الفوائد الرئيسية
- **مستجيبون خارجيون**: أي شخص لديه بريد إلكتروني يمكنه الاستجابة، حتى غير مستخدمي المنصة
- **تعيين ديناميكي**: استخراج بريد المُعيَّن من حالة التدفق (مثل `account_owner_email`)
- **تهيئة بسيطة**: التوجيه عبر البريد الإلكتروني أسهل في الإعداد من إدارة المستخدمين/الأدوار
- **احتياطي منشئ النشر**: إذا لم تتطابق قاعدة توجيه، يتم إخطار منشئ النشر
<Tip>
لتفاصيل التنفيذ حول مُزخرف `@human_feedback`، راجع دليل [التغذية الراجعة البشرية في التدفقات](/ar/learn/human-feedback-in-flows).
</Tip>
## إعداد سير عمل HITL القائم على Webhook
للتكاملات المخصصة مع الأنظمة الخارجية مثل Slack وMicrosoft Teams أو تطبيقاتك الخاصة، يمكنك استخدام النهج القائم على Webhook:
<Steps>
<Step title="تهيئة المهمة">
هيّئ مهمتك مع تفعيل الإدخال البشري:
<Frame>
<img src="/images/enterprise/crew-human-input.png" alt="إدخال بشري للطاقم" />
</Frame>
</Step>
<Step title="تقديم رابط Webhook">
عند تشغيل طاقمك، أضف رابط webhook للإدخال البشري:
<Frame>
<img src="/images/enterprise/crew-webhook-url.png" alt="رابط Webhook للطاقم" />
</Frame>
</Step>
<Step title="استلام إشعار Webhook">
بمجرد إتمام الطاقم للمهمة التي تتطلب إدخالاً بشرياً، ستتلقى إشعار webhook يحتوي على:
- **معرّف التنفيذ**
- **معرّف المهمة**
- **مخرجات المهمة**
</Step>
<Step title="مراجعة مخرجات المهمة">
سيتوقف النظام في حالة `Pending Human Input`. راجع مخرجات المهمة بعناية.
</Step>
<Step title="إرسال التغذية الراجعة البشرية">
استدعِ نقطة نهاية الاستئناف لطاقمك بالمعلومات التالية:
<Frame>
<img src="/images/enterprise/crew-resume-endpoint.png" alt="نقطة نهاية استئناف الطاقم" />
</Frame>
<Warning>
**هام: يجب تقديم روابط Webhook مرة أخرى**:
**يجب** تقديم نفس روابط webhook (`taskWebhookUrl`، `stepWebhookUrl`، `crewWebhookUrl`) في استدعاء الاستئناف التي استخدمتها في استدعاء التشغيل. لا تُنقل تهيئات Webhook تلقائياً من التشغيل — يجب تضمينها صراحة في طلب الاستئناف لمواصلة تلقي الإشعارات لاكتمال المهام وخطوات الوكيل واكتمال الطاقم.
</Warning>
مثال على استدعاء الاستئناف مع webhooks:
```bash
curl -X POST {BASE_URL}/resume \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"execution_id": "abcd1234-5678-90ef-ghij-klmnopqrstuv",
"task_id": "research_task",
"human_feedback": "Great work! Please add more details.",
"is_approve": true,
"taskWebhookUrl": "https://your-server.com/webhooks/task",
"stepWebhookUrl": "https://your-server.com/webhooks/step",
"crewWebhookUrl": "https://your-server.com/webhooks/crew"
}'
```
<Warning>
**تأثير التغذية الراجعة على تنفيذ المهمة**:
من الضروري توخي الحذر عند تقديم التغذية الراجعة، حيث سيتم دمج محتوى التغذية الراجعة بالكامل كسياق إضافي لعمليات تنفيذ المهام اللاحقة.
</Warning>
وهذا يعني:
- جميع المعلومات في تغذيتك الراجعة تصبح جزءاً من سياق المهمة.
- التفاصيل غير ذات الصلة قد تؤثر سلباً عليها.
- التغذية الراجعة الموجزة وذات الصلة تساعد في الحفاظ على تركيز وكفاءة المهمة.
- راجع دائماً تغذيتك الراجعة بعناية قبل الإرسال للتأكد من أنها تحتوي فقط على معلومات ذات صلة توجه تنفيذ المهمة بشكل إيجابي.
</Step>
<Step title="التعامل مع التغذية الراجعة السلبية">
إذا قدمت تغذية راجعة سلبية:
- سيعيد الطاقم محاولة المهمة مع سياق إضافي من تغذيتك الراجعة.
- ستتلقى إشعار webhook آخر لمزيد من المراجعة.
- كرر الخطوات 4-6 حتى ترضى.
</Step>
<Step title="استمرار التنفيذ">
عندما ترسل تغذية راجعة إيجابية، سيستمر التنفيذ إلى الخطوات التالية.
</Step>
</Steps>
## أفضل الممارسات
- **كن محدداً**: قدم تغذية راجعة واضحة وقابلة للتنفيذ تعالج المهمة مباشرة
- **كن ذا صلة**: ضمّن فقط المعلومات التي ستساعد في تحسين تنفيذ المهمة
- **كن سريعاً**: استجب لمطالبات HITL بسرعة لتجنب تأخير سير العمل
- **راجع بعناية**: تحقق من تغذيتك الراجعة قبل الإرسال لضمان الدقة
## حالات الاستخدام الشائعة
سير عمل HITL ذو قيمة خاصة لـ:
- ضمان الجودة والتحقق
- سيناريوهات اتخاذ القرار المعقدة
- العمليات الحساسة أو عالية المخاطر
- المهام الإبداعية التي تتطلب حكماً بشرياً
- مراجعات الامتثال والتنظيم
## اعرف المزيد
<CardGroup cols={2}>
<Card title="إدارة HITL للتدفقات" icon="users-gear" href="/ar/enterprise/features/flow-hitl-management">
استكشف قدرات منصة Enterprise الكاملة لـ Flow HITL بما في ذلك إشعارات البريد الإلكتروني وقواعد التوجيه والاستجابة التلقائية والتحليلات.
</Card>
<Card title="التغذية الراجعة البشرية في التدفقات" icon="code" href="/ar/learn/human-feedback-in-flows">
دليل التنفيذ لمُزخرف `@human_feedback` في تدفقاتك.
</Card>
</CardGroup>

View File

@@ -0,0 +1,178 @@
---
title: "تشغيل الطاقم"
description: "تشغيل طاقم على CrewAI AMP"
icon: "flag-checkered"
mode: "wide"
---
## نظرة عامة
بمجرد نشر طاقمك على منصة CrewAI AMP، يمكنك بدء عمليات التنفيذ عبر واجهة الويب أو API. يغطي هذا الدليل كلا النهجين.
## الطريقة 1: استخدام واجهة الويب
### الخطوة 1: الانتقال إلى طاقمك المنشور
1. سجّل الدخول إلى [CrewAI AMP](https://app.crewai.com)
2. انقر على اسم الطاقم من قائمة مشاريعك
3. ستنتقل إلى صفحة تفاصيل الطاقم
<Frame>![لوحة تحكم الطاقم](/images/enterprise/crew-dashboard.png)</Frame>
### الخطوة 2: بدء التنفيذ
من صفحة تفاصيل طاقمك، لديك خياران لبدء التنفيذ:
#### الخيار أ: التشغيل السريع
1. انقر على رابط `Kickoff` في قسم Test Endpoints
2. أدخل معاملات الإدخال المطلوبة لطاقمك في محرر JSON
3. انقر على زر `Send Request`
<Frame>![نقطة نهاية التشغيل](/images/enterprise/kickoff-endpoint.png)</Frame>
#### الخيار ب: استخدام الواجهة المرئية
1. انقر على علامة تبويب `Run` في صفحة تفاصيل الطاقم
2. أدخل المدخلات المطلوبة في حقول النموذج
3. انقر على زر `Run Crew`
<Frame>![تشغيل الطاقم](/images/enterprise/run-crew.png)</Frame>
### الخطوة 3: مراقبة تقدم التنفيذ
بعد بدء التنفيذ:
1. ستتلقى استجابة تحتوي على `kickoff_id` - **انسخ هذا المعرّف**
2. هذا المعرّف ضروري لتتبع تنفيذك
<Frame>![نسخ معرّف المهمة](/images/enterprise/copy-task-id.png)</Frame>
### الخطوة 4: التحقق من حالة التنفيذ
لمراقبة تقدم تنفيذك:
1. انقر على نقطة نهاية "Status" في قسم Test Endpoints
2. الصق `kickoff_id` في الحقل المخصص
3. انقر على زر "Get Status"
<Frame>![الحصول على الحالة](/images/enterprise/get-status.png)</Frame>
ستعرض استجابة الحالة:
- حالة التنفيذ الحالية (`running`، `completed`، إلخ.)
- تفاصيل حول المهام الجارية
- أي مخرجات أُنتجت حتى الآن
### الخطوة 5: عرض النتائج النهائية
بمجرد اكتمال التنفيذ:
1. ستتغير الحالة إلى `completed`
2. يمكنك عرض نتائج ومخرجات التنفيذ الكاملة
3. لعرض أكثر تفصيلاً، تحقق من علامة تبويب `Executions` في صفحة تفاصيل الطاقم
## الطريقة 2: استخدام API
يمكنك أيضاً تشغيل الطواقم برمجياً باستخدام REST API لـ CrewAI AMP.
### المصادقة
جميع طلبات API تتطلب رمز حامل للمصادقة:
```bash
curl -H "Authorization: Bearer YOUR_CREW_TOKEN" https://your-crew-url.crewai.com
```
رمز الحامل متاح في علامة تبويب Status في صفحة تفاصيل طاقمك.
### التحقق من صحة الطاقم
قبل تنفيذ العمليات، يمكنك التحقق من أن طاقمك يعمل بشكل صحيح:
```bash
curl -H "Authorization: Bearer YOUR_CREW_TOKEN" https://your-crew-url.crewai.com
```
ستعيد الاستجابة الناجحة رسالة تشير إلى أن الطاقم يعمل:
```
Healthy%
```
### الخطوة 1: استرداد المدخلات المطلوبة
أولاً، حدد المدخلات التي يتطلبها طاقمك:
```bash
curl -X GET \
-H "Authorization: Bearer YOUR_CREW_TOKEN" \
https://your-crew-url.crewai.com/inputs
```
ستكون الاستجابة كائن JSON يحتوي على مصفوفة من معاملات الإدخال المطلوبة، على سبيل المثال:
```json
{ "inputs": ["topic", "current_year"] }
```
يوضح هذا المثال أن هذا الطاقم المحدد يتطلب مدخلين: `topic` و`current_year`.
### الخطوة 2: بدء التنفيذ
ابدأ التنفيذ بتقديم المدخلات المطلوبة:
```bash
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_CREW_TOKEN" \
-d '{"inputs": {"topic": "AI Agent Frameworks", "current_year": "2025"}}' \
https://your-crew-url.crewai.com/kickoff
```
ستتضمن الاستجابة `kickoff_id` الذي ستحتاجه للتتبع:
```json
{ "kickoff_id": "abcd1234-5678-90ef-ghij-klmnopqrstuv" }
```
### الخطوة 3: التحقق من حالة التنفيذ
راقب تقدم التنفيذ باستخدام kickoff_id:
```bash
curl -X GET \
-H "Authorization: Bearer YOUR_CREW_TOKEN" \
https://your-crew-url.crewai.com/status/abcd1234-5678-90ef-ghij-klmnopqrstuv
```
## التعامل مع عمليات التنفيذ
### عمليات التنفيذ طويلة المدة
لعمليات التنفيذ التي قد تستغرق وقتاً طويلاً:
1. فكّر في تنفيذ آلية استعلام دوري للتحقق من الحالة بشكل دوري
2. استخدم webhooks (إذا كانت متاحة) للإشعار عند اكتمال التنفيذ
3. نفّذ معالجة الأخطاء للمهلات الزمنية المحتملة
### سياق التنفيذ
يتضمن سياق التنفيذ:
- المدخلات المقدمة عند التشغيل
- متغيرات البيئة المُهيأة أثناء النشر
- أي حالة محفوظة بين المهام
### تصحيح أخطاء عمليات التنفيذ الفاشلة
إذا فشل التنفيذ:
1. تحقق من علامة تبويب "Executions" للسجلات المفصلة
2. راجع علامة تبويب "Traces" لتفاصيل التنفيذ خطوة بخطوة
3. ابحث عن استجابات LLM واستخدام الأدوات في تفاصيل التتبع
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للمساعدة في مشاكل التنفيذ أو أسئلة حول
منصة Enterprise.
</Card>

View File

@@ -0,0 +1,70 @@
---
title: "مشغل Microsoft Teams"
description: "تشغيل الطواقم من نشاط محادثات Microsoft Teams"
icon: "microsoft"
mode: "wide"
---
## نظرة عامة
استخدم مشغل Microsoft Teams لبدء الأتمتات كلما أُنشئت محادثة جديدة. تشمل الأنماط الشائعة تلخيص الطلبات الواردة وتوجيه الرسائل العاجلة لفرق الدعم أو إنشاء مهام متابعة في أنظمة أخرى.
<Tip>
تأكد من ربط Microsoft Teams تحت **Tools & Integrations** و
تفعيله في علامة تبويب **Triggers** لعملية النشر.
</Tip>
## تفعيل مشغل Microsoft Teams
1. افتح عملية النشر في CrewAI AMP
2. انتقل إلى علامة تبويب **Triggers**
3. حدد موقع **Microsoft Teams** وبدّل مفتاح التبديل للتفعيل
<Frame caption="اتصال مشغل Microsoft Teams">
<img
src="/images/enterprise/msteams-trigger.png"
alt="تفعيل أو تعطيل المشغلات بالتبديل"
/>
</Frame>
## مثال: تلخيص سلسلة محادثة جديدة
```python
from teams_chat_created_crew import MicrosoftTeamsChatTrigger
crew = MicrosoftTeamsChatTrigger().crew()
result = crew.kickoff({
"crewai_trigger_payload": teams_payload,
})
print(result.raw)
```
يحلل الطاقم بيانات المحادثة الوصفية (الموضوع، وقت الإنشاء، قائمة الأعضاء) وينشئ خطة عمل للفريق المستقبل.
## الاختبار المحلي
اختبر تكامل مشغل Microsoft Teams محلياً باستخدام CrewAI CLI:
```bash
# عرض جميع المشغلات المتاحة
crewai triggers list
# محاكاة مشغل Microsoft Teams بحمولة واقعية
crewai triggers run microsoft_teams/teams_message_created
```
سينفذ أمر `crewai triggers run` طاقمك بحمولة Teams كاملة، مما يتيح لك اختبار منطق التحليل قبل النشر.
<Warning>
استخدم `crewai triggers run microsoft_teams/teams_message_created` (وليس `crewai
run`) لمحاكاة تنفيذ المشغل أثناء التطوير. بعد النشر، سيتلقى
طاقمك حمولة المشغل تلقائياً.
</Warning>
## استكشاف الأخطاء وإصلاحها
- تأكد من أن اتصال Teams نشط؛ يجب تحديثه إذا سحب المستأجر الصلاحيات
- اختبر محلياً بـ `crewai triggers run microsoft_teams/teams_message_created` لرؤية هيكل الحمولة بالضبط
- تأكد من أن اشتراك webhook في Microsoft 365 لا يزال صالحاً إذا توقفت الحمولات عن الوصول
- راجع سجلات التنفيذ لعدم تطابق شكل الحمولة — قد تحذف إشعارات Graph حقولاً عندما تكون المحادثة خاصة أو مقيدة
- تذكر: استخدم `crewai triggers run` (وليس `crewai run`) لمحاكاة تنفيذ المشغل

View File

@@ -0,0 +1,69 @@
---
title: "مشغل OneDrive"
description: "أتمتة الاستجابات لنشاط ملفات OneDrive"
icon: "cloud"
mode: "wide"
---
## نظرة عامة
ابدأ الأتمتات عند تغيير الملفات داخل OneDrive. يمكنك إنشاء ملخصات تدقيق وإخطار فرق الأمان بشأن المشاركة الخارجية أو تحديث أنظمة الأعمال اللاحقة ببيانات المستندات الوصفية الجديدة.
<Tip>
اربط OneDrive في **Tools & Integrations** وبدّل المشغل لعملية
النشر.
</Tip>
## تفعيل مشغل OneDrive
1. افتح عملية النشر في CrewAI AMP
2. انتقل إلى علامة تبويب **Triggers**
3. حدد موقع **OneDrive** وبدّل مفتاح التبديل للتفعيل
<Frame caption="اتصال مشغل Microsoft OneDrive">
<img
src="/images/enterprise/onedrive-trigger.png"
alt="تفعيل أو تعطيل المشغلات بالتبديل"
/>
</Frame>
## مثال: تدقيق صلاحيات الملفات
```python
from onedrive_file_crew import OneDriveFileTrigger
crew = OneDriveFileTrigger().crew()
crew.kickoff({
"crewai_trigger_payload": onedrive_payload,
})
```
يفحص الطاقم بيانات الملف الوصفية ونشاط المستخدم وتغييرات الصلاحيات لإنتاج ملخص متوافق مع متطلبات الامتثال.
## الاختبار المحلي
اختبر تكامل مشغل OneDrive محلياً باستخدام CrewAI CLI:
```bash
# عرض جميع المشغلات المتاحة
crewai triggers list
# محاكاة مشغل OneDrive بحمولة واقعية
crewai triggers run microsoft_onedrive/file_changed
```
سينفذ أمر `crewai triggers run` طاقمك بحمولة OneDrive كاملة، مما يتيح لك اختبار منطق التحليل قبل النشر.
<Warning>
استخدم `crewai triggers run microsoft_onedrive/file_changed` (وليس `crewai run`)
لمحاكاة تنفيذ المشغل أثناء التطوير. بعد النشر، سيتلقى طاقمك
حمولة المشغل تلقائياً.
</Warning>
## استكشاف الأخطاء وإصلاحها
- تأكد من أن الحساب المتصل لديه صلاحية قراءة بيانات الملف الوصفية المضمنة في webhook
- اختبر محلياً بـ `crewai triggers run microsoft_onedrive/file_changed` لرؤية هيكل الحمولة بالضبط
- إذا كان المشغل يعمل لكن الحمولة تفتقد `permissions`، تأكد من أن إعدادات المشاركة على مستوى الموقع تسمح لـ Graph بإرجاع هذا الحقل
- للمستأجرين الكبار، صفّ الإشعارات مسبقاً حتى يعمل الطاقم فقط على المجلدات ذات الصلة
- تذكر: استخدم `crewai triggers run` (وليس `crewai run`) لمحاكاة تنفيذ المشغل

View File

@@ -0,0 +1,69 @@
---
title: "مشغل Outlook"
description: "إطلاق الأتمتات من رسائل Outlook وتحديثات التقويم"
icon: "microsoft"
mode: "wide"
---
## نظرة عامة
أتمت الاستجابات عندما يسلّم Outlook رسالة جديدة أو عند إزالة حدث من التقويم. تقوم الفرق عادة بتوجيه التصعيدات وإنشاء تذاكر أو تنبيه الحاضرين بالإلغاءات.
<Tip>
اربط Outlook في **Tools & Integrations** وتأكد من تفعيل المشغل
لعملية النشر.
</Tip>
## تفعيل مشغل Outlook
1. افتح عملية النشر في CrewAI AMP
2. انتقل إلى علامة تبويب **Triggers**
3. حدد موقع **Outlook** وبدّل مفتاح التبديل للتفعيل
<Frame caption="اتصال مشغل Microsoft Outlook">
<img
src="/images/enterprise/outlook-trigger.png"
alt="تفعيل أو تعطيل المشغلات بالتبديل"
/>
</Frame>
## مثال: تلخيص رسالة بريد إلكتروني جديدة
```python
from outlook_message_crew import OutlookMessageTrigger
crew = OutlookMessageTrigger().crew()
crew.kickoff({
"crewai_trigger_payload": outlook_payload,
})
```
يستخرج الطاقم تفاصيل المرسل والموضوع ومعاينة النص والمرفقات قبل إنشاء استجابة منظمة.
## الاختبار المحلي
اختبر تكامل مشغل Outlook محلياً باستخدام CrewAI CLI:
```bash
# عرض جميع المشغلات المتاحة
crewai triggers list
# محاكاة مشغل Outlook بحمولة واقعية
crewai triggers run microsoft_outlook/email_received
```
سينفذ أمر `crewai triggers run` طاقمك بحمولة Outlook كاملة، مما يتيح لك اختبار منطق التحليل قبل النشر.
<Warning>
استخدم `crewai triggers run microsoft_outlook/email_received` (وليس `crewai run`)
لمحاكاة تنفيذ المشغل أثناء التطوير. بعد النشر، سيتلقى طاقمك
حمولة المشغل تلقائياً.
</Warning>
## استكشاف الأخطاء وإصلاحها
- تحقق من أن موصل Outlook لا يزال مفوّضاً؛ يجب تجديد الاشتراك دورياً
- اختبر محلياً بـ `crewai triggers run microsoft_outlook/email_received` لرؤية هيكل الحمولة بالضبط
- إذا كانت المرفقات مفقودة، تأكد من أن اشتراك webhook يتضمن علامة `includeResourceData`
- راجع سجلات التنفيذ عندما تفشل الأحداث في المطابقة — حمولات الإلغاء تفتقد قوائم الحاضرين حسب التصميم ويجب أن يأخذ الطاقم ذلك في الاعتبار
- تذكر: استخدم `crewai triggers run` (وليس `crewai run`) لمحاكاة تنفيذ المشغل

View File

@@ -0,0 +1,311 @@
---
title: "التحضير للنشر"
description: "تأكد من جاهزية طاقمك أو تدفقك للنشر على CrewAI AMP"
icon: "clipboard-check"
mode: "wide"
---
<Note>
قبل النشر على CrewAI AMP، من الضروري التحقق من صحة بنية مشروعك.
يمكن نشر كل من الطواقم والتدفقات كـ "أتمتات"، لكن لهما بنى مشاريع
ومتطلبات مختلفة يجب استيفاؤها لنجاح النشر.
</Note>
## فهم الأتمتات
في CrewAI AMP، **الأتمتات** هو المصطلح الشامل لمشاريع الذكاء الاصطناعي الوكيل القابلة للنشر. يمكن أن تكون الأتمتة إما:
- **طاقم**: فريق مستقل من وكلاء الذكاء الاصطناعي يعملون معاً على المهام
- **تدفق**: سير عمل مُنسّق يمكنه الجمع بين طواقم متعددة واستدعاءات LLM المباشرة والمنطق الإجرائي
فهم النوع الذي تنشره ضروري لأن لهما بنى مشاريع ونقاط دخول مختلفة.
## الطواقم مقابل التدفقات: الفروقات الرئيسية
<CardGroup cols={2}>
<Card title="مشاريع الطاقم" icon="users">
فرق وكلاء ذكاء اصطناعي مستقلة مع `crew.py` يحدد الوكلاء والمهام. الأفضل للمهام المركزة والتعاونية.
</Card>
<Card title="مشاريع التدفق" icon="diagram-project">
سير عمل مُنسّق مع طواقم مضمنة في مجلد `crews/`. الأفضل للعمليات المعقدة متعددة المراحل.
</Card>
</CardGroup>
| الجانب | الطاقم | التدفق |
|--------|--------|--------|
| **بنية المشروع** | `src/project_name/` مع `crew.py` | `src/project_name/` مع مجلد `crews/` |
| **موقع المنطق الرئيسي** | `src/project_name/crew.py` | `src/project_name/main.py` (فئة Flow) |
| **دالة نقطة الدخول** | `run()` في `main.py` | `kickoff()` في `main.py` |
| **نوع pyproject.toml** | `type = "crew"` | `type = "flow"` |
| **أمر CLI للإنشاء** | `crewai create crew name` | `crewai create flow name` |
| **موقع التهيئة** | `src/project_name/config/` | `src/project_name/crews/crew_name/config/` |
| **يمكن أن يحتوي طواقم أخرى** | لا | نعم (في مجلد `crews/`) |
## مرجع بنية المشروع
### بنية مشروع الطاقم
عند تشغيل `crewai create crew my_crew`، تحصل على هذه البنية:
```
my_crew/
├── .gitignore
├── pyproject.toml # Must have type = "crew"
├── README.md
├── .env
├── uv.lock # REQUIRED for deployment
└── src/
└── my_crew/
├── __init__.py
├── main.py # Entry point with run() function
├── crew.py # Crew class with @CrewBase decorator
├── tools/
│ ├── custom_tool.py
│ └── __init__.py
└── config/
├── agents.yaml # Agent definitions
└── tasks.yaml # Task definitions
```
<Warning>
بنية `src/project_name/` المتداخلة ضرورية للطواقم.
وضع الملفات في المستوى الخاطئ سيسبب فشل النشر.
</Warning>
### بنية مشروع التدفق
عند تشغيل `crewai create flow my_flow`، تحصل على هذه البنية:
```
my_flow/
├── .gitignore
├── pyproject.toml # Must have type = "flow"
├── README.md
├── .env
├── uv.lock # REQUIRED for deployment
└── src/
└── my_flow/
├── __init__.py
├── main.py # Entry point with kickoff() function + Flow class
├── crews/ # Embedded crews folder
│ └── poem_crew/
│ ├── __init__.py
│ ├── poem_crew.py # Crew with @CrewBase decorator
│ └── config/
│ ├── agents.yaml
│ └── tasks.yaml
└── tools/
├── __init__.py
└── custom_tool.py
```
<Info>
كلا الطواقم والتدفقات تستخدم بنية `src/project_name/`.
الفرق الرئيسي أن التدفقات لها مجلد `crews/` للطواقم المضمنة،
بينما الطواقم لها `crew.py` مباشرة في مجلد المشروع.
</Info>
## قائمة فحص ما قبل النشر
استخدم هذه القائمة للتحقق من جاهزية مشروعك للنشر.
### 1. التحقق من تهيئة pyproject.toml
يجب أن يتضمن `pyproject.toml` قسم `[tool.crewai]` الصحيح:
<Tabs>
<Tab title="للطواقم">
```toml
[tool.crewai]
type = "crew"
```
</Tab>
<Tab title="للتدفقات">
```toml
[tool.crewai]
type = "flow"
```
</Tab>
</Tabs>
<Warning>
إذا لم يتطابق `type` مع بنية مشروعك، سيفشل البناء أو
لن تعمل الأتمتة بشكل صحيح.
</Warning>
### 2. التأكد من وجود ملف uv.lock
يستخدم CrewAI `uv` لإدارة الاعتماديات. يضمن ملف `uv.lock` بناءً قابلاً للتكرار وهو **مطلوب** للنشر.
```bash
# إنشاء أو تحديث ملف القفل
uv lock
# التحقق من وجوده
ls -la uv.lock
```
إذا لم يكن الملف موجوداً، شغّل `uv lock` وارفعه إلى مستودعك:
```bash
uv lock
git add uv.lock
git commit -m "Add uv.lock for deployment"
git push
```
### 3. التحقق من استخدام مُزخرف CrewBase
**يجب أن تستخدم كل فئة طاقم مُزخرف `@CrewBase`.** ينطبق هذا على:
- مشاريع الطاقم المستقلة
- الطواقم المضمنة داخل مشاريع التدفق
```python
from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task
from crewai.agents.agent_builder.base_agent import BaseAgent
from typing import List
@CrewBase # This decorator is REQUIRED
class MyCrew():
"""My crew description"""
agents: List[BaseAgent]
tasks: List[Task]
@agent
def my_agent(self) -> Agent:
return Agent(
config=self.agents_config['my_agent'], # type: ignore[index]
verbose=True
)
@task
def my_task(self) -> Task:
return Task(
config=self.tasks_config['my_task'] # type: ignore[index]
)
@crew
def crew(self) -> Crew:
return Crew(
agents=self.agents,
tasks=self.tasks,
process=Process.sequential,
verbose=True,
)
```
<Warning>
إذا نسيت مُزخرف `@CrewBase`، سيفشل النشر بأخطاء حول
تهيئات الوكلاء أو المهام المفقودة.
</Warning>
### 4. التحقق من نقاط دخول المشروع
كل من الطواقم والتدفقات لها نقطة دخول في `src/project_name/main.py`:
<Tabs>
<Tab title="للطواقم">
تستخدم نقطة الدخول دالة `run()`:
```python
# src/my_crew/main.py
from my_crew.crew import MyCrew
def run():
"""Run the crew."""
inputs = {'topic': 'AI in Healthcare'}
result = MyCrew().crew().kickoff(inputs=inputs)
return result
if __name__ == "__main__":
run()
```
</Tab>
<Tab title="للتدفقات">
تستخدم نقطة الدخول دالة `kickoff()` مع فئة Flow:
```python
# src/my_flow/main.py
from crewai.flow import Flow, listen, start
from my_flow.crews.poem_crew.poem_crew import PoemCrew
class MyFlow(Flow):
@start()
def begin(self):
# Flow logic here
result = PoemCrew().crew().kickoff(inputs={...})
return result
def kickoff():
"""Run the flow."""
MyFlow().kickoff()
if __name__ == "__main__":
kickoff()
```
</Tab>
</Tabs>
### 5. تحضير متغيرات البيئة
قبل النشر، تأكد من أن لديك:
1. **مفاتيح API لـ LLM** جاهزة (OpenAI، Anthropic، Google، إلخ.)
2. **مفاتيح API للأدوات** إذا كنت تستخدم أدوات خارجية (Serper، إلخ.)
<Info>
إذا كان مشروعك يعتمد على حزم من **سجل PyPI خاص**، ستحتاج أيضاً لتهيئة
بيانات اعتماد مصادقة السجل كمتغيرات بيئة. راجع
دليل [سجلات الحزم الخاصة](/ar/enterprise/guides/private-package-registry) للتفاصيل.
</Info>
<Tip>
اختبر مشروعك محلياً بنفس متغيرات البيئة قبل النشر
لاكتشاف مشاكل التهيئة مبكراً.
</Tip>
## أوامر التحقق السريع
شغّل هذه الأوامر من جذر مشروعك للتحقق السريع من إعدادك:
```bash
# 1. Check project type in pyproject.toml
grep -A2 "\[tool.crewai\]" pyproject.toml
# 2. Verify uv.lock exists
ls -la uv.lock || echo "ERROR: uv.lock missing! Run 'uv lock'"
# 3. Verify src/ structure exists
ls -la src/*/main.py 2>/dev/null || echo "No main.py found in src/"
# 4. For Crews - verify crew.py exists
ls -la src/*/crew.py 2>/dev/null || echo "No crew.py (expected for Crews)"
# 5. For Flows - verify crews/ folder exists
ls -la src/*/crews/ 2>/dev/null || echo "No crews/ folder (expected for Flows)"
# 6. Check for CrewBase usage
grep -r "@CrewBase" . --include="*.py"
```
## أخطاء الإعداد الشائعة
| الخطأ | العرض | الإصلاح |
|-------|-------|---------|
| `uv.lock` مفقود | فشل البناء أثناء حل الاعتماديات | شغّل `uv lock` وارفعه |
| `type` خاطئ في pyproject.toml | نجاح البناء لكن فشل وقت التشغيل | غيّر إلى النوع الصحيح |
| مُزخرف `@CrewBase` مفقود | أخطاء "Config not found" | أضف المُزخرف لجميع فئات الطاقم |
| ملفات في الجذر بدل `src/` | نقطة الدخول غير موجودة | انقلها إلى `src/project_name/` |
| `run()` أو `kickoff()` مفقودة | لا يمكن بدء الأتمتة | أضف دالة الدخول الصحيحة |
## الخطوات التالية
بمجرد اجتياز مشروعك لجميع عناصر القائمة، أنت جاهز للنشر:
<Card title="النشر على AMP" icon="rocket" href="/ar/enterprise/guides/deploy-to-amp">
اتبع دليل النشر لنشر طاقمك أو تدفقك على CrewAI AMP باستخدام
CLI أو واجهة الويب أو تكامل CI/CD.
</Card>

View File

@@ -0,0 +1,263 @@
---
title: "سجلات الحزم الخاصة"
description: "تثبيت حزم Python الخاصة من سجلات PyPI المصادق عليها في CrewAI AMP"
icon: "lock"
mode: "wide"
---
<Note>
يغطي هذا الدليل كيفية تهيئة مشروع CrewAI لتثبيت حزم Python
من سجلات PyPI الخاصة (Azure DevOps Artifacts، GitHub Packages، GitLab، AWS CodeArtifact، إلخ.)
عند النشر على CrewAI AMP.
</Note>
## متى تحتاج هذا
إذا كان مشروعك يعتمد على حزم Python داخلية أو خاصة مستضافة على سجل خاص
بدلاً من PyPI العام، ستحتاج إلى:
1. إخبار UV **أين** يجد الحزمة (رابط فهرس)
2. إخبار UV **أي** حزم تأتي من ذلك الفهرس (تعيين مصدر)
3. تقديم **بيانات اعتماد** حتى يتمكن UV من المصادقة أثناء التثبيت
يستخدم CrewAI AMP [UV](https://docs.astral.sh/uv/) لحل وتثبيت الاعتماديات.
يدعم UV السجلات الخاصة المصادق عليها عبر تهيئة `pyproject.toml` مع
متغيرات بيئة لبيانات الاعتماد.
## الخطوة 1: تهيئة pyproject.toml
ثلاثة أجزاء تعمل معاً في `pyproject.toml`:
### 1أ. التصريح بالاعتمادية
أضف الحزمة الخاصة إلى `[project.dependencies]` كأي اعتمادية أخرى:
```toml
[project]
dependencies = [
"crewai[tools]>=0.100.1,<1.0.0",
"my-private-package>=1.2.0",
]
```
### 1ب. تعريف الفهرس
سجّل سجلك الخاص كفهرس مسمّى تحت `[[tool.uv.index]]`:
```toml
[[tool.uv.index]]
name = "my-private-registry"
url = "https://pkgs.dev.azure.com/my-org/_packaging/my-feed/pypi/simple/"
explicit = true
```
<Info>
حقل `name` مهم — يستخدمه UV لبناء أسماء متغيرات البيئة
للمصادقة (راجع [الخطوة 2](#step-2-set-authentication-credentials) أدناه).
تعيين `explicit = true` يعني أن UV لن يبحث في هذا الفهرس عن كل حزمة — فقط
الحزم التي تعيّنها صراحة له في `[tool.uv.sources]`. يتجنب ذلك الاستعلامات غير الضرورية
ضد سجلك الخاص ويحمي من هجمات ارتباك الاعتماديات.
</Info>
### 1ج. تعيين الحزمة للفهرس
أخبر UV أي حزم يجب حلها من فهرسك الخاص باستخدام `[tool.uv.sources]`:
```toml
[tool.uv.sources]
my-private-package = { index = "my-private-registry" }
```
### مثال كامل
```toml
[project]
name = "my-crew-project"
version = "0.1.0"
requires-python = ">=3.10,<=3.13"
dependencies = [
"crewai[tools]>=0.100.1,<1.0.0",
"my-private-package>=1.2.0",
]
[tool.crewai]
type = "crew"
[[tool.uv.index]]
name = "my-private-registry"
url = "https://pkgs.dev.azure.com/my-org/_packaging/my-feed/pypi/simple/"
explicit = true
[tool.uv.sources]
my-private-package = { index = "my-private-registry" }
```
بعد تحديث `pyproject.toml`، أعد إنشاء ملف القفل:
```bash
uv lock
```
<Warning>
ارفع دائماً `uv.lock` المُحدّث مع تغييرات `pyproject.toml`.
ملف القفل مطلوب للنشر — راجع [التحضير للنشر](/ar/enterprise/guides/prepare-for-deployment).
</Warning>
## الخطوة 2: تعيين بيانات اعتماد المصادقة
يصادق UV ضد الفهارس الخاصة باستخدام متغيرات بيئة تتبع اصطلاح تسمية
بناءً على اسم الفهرس الذي حددته في `pyproject.toml`:
```
UV_INDEX_{UPPER_NAME}_USERNAME
UV_INDEX_{UPPER_NAME}_PASSWORD
```
حيث `{UPPER_NAME}` هو اسم فهرسك محوّلاً إلى **أحرف كبيرة** مع **استبدال الشرطات بشرطات سفلية**.
على سبيل المثال، فهرس باسم `my-private-registry` يستخدم:
| المتغير | القيمة |
|---------|--------|
| `UV_INDEX_MY_PRIVATE_REGISTRY_USERNAME` | اسم مستخدم السجل أو اسم الرمز |
| `UV_INDEX_MY_PRIVATE_REGISTRY_PASSWORD` | كلمة مرور السجل أو الرمز/PAT |
<Warning>
هذه المتغيرات **يجب** إضافتها عبر إعدادات **Environment Variables** في CrewAI AMP —
إما عالمياً أو على مستوى النشر. لا يمكن تعيينها في ملفات `.env` أو ترميزها في مشروعك.
راجع [تعيين متغيرات البيئة في AMP](#setting-environment-variables-in-amp) أدناه.
</Warning>
## مرجع مزودي السجلات
يوضح الجدول أدناه تنسيق رابط الفهرس وقيم بيانات الاعتماد لمزودي السجلات الشائعين.
استبدل القيم المؤقتة بتفاصيل مؤسستك وخلاصتك الفعلية.
| المزود | رابط الفهرس | اسم المستخدم | كلمة المرور |
|--------|-------------|--------------|-------------|
| **Azure DevOps Artifacts** | `https://pkgs.dev.azure.com/{org}/_packaging/{feed}/pypi/simple/` | أي نص غير فارغ (مثل `token`) | Personal Access Token (PAT) بنطاق Packaging Read |
| **GitHub Packages** | `https://pypi.pkg.github.com/{owner}/simple/` | اسم مستخدم GitHub | Personal Access Token (classic) بنطاق `read:packages` |
| **GitLab Package Registry** | `https://gitlab.com/api/v4/projects/{project_id}/packages/pypi/simple/` | `__token__` | Project أو Personal Access Token بنطاق `read_api` |
| **AWS CodeArtifact** | استخدم الرابط من `aws codeartifact get-repository-endpoint` | `aws` | رمز من `aws codeartifact get-authorization-token` |
| **Google Artifact Registry** | `https://{region}-python.pkg.dev/{project}/{repo}/simple/` | `_json_key_base64` | مفتاح حساب الخدمة بتشفير Base64 |
| **JFrog Artifactory** | `https://{instance}.jfrog.io/artifactory/api/pypi/{repo}/simple/` | اسم المستخدم أو البريد الإلكتروني | مفتاح API أو رمز الهوية |
| **مستضاف ذاتياً (devpi، Nexus، إلخ.)** | رابط Simple API لسجلك | اسم مستخدم السجل | كلمة مرور السجل |
<Tip>
لـ **AWS CodeArtifact**، تنتهي صلاحية رمز التفويض دورياً.
ستحتاج لتحديث قيمة `UV_INDEX_*_PASSWORD` عند انتهاء صلاحيتها.
فكّر في أتمتة هذا في خط أنابيب CI/CD.
</Tip>
## تعيين متغيرات البيئة في AMP
يجب تهيئة بيانات اعتماد السجل الخاص كمتغيرات بيئة في CrewAI AMP.
لديك خياران:
<Tabs>
<Tab title="واجهة الويب">
1. سجّل الدخول إلى [CrewAI AMP](https://app.crewai.com)
2. انتقل إلى أتمتتك
3. افتح علامة تبويب **Environment Variables**
4. أضف كل متغير (`UV_INDEX_*_USERNAME` و`UV_INDEX_*_PASSWORD`) مع قيمته
راجع خطوة [النشر على AMP — تعيين متغيرات البيئة](/ar/enterprise/guides/deploy-to-amp#set-environment-variables) للتفاصيل.
</Tab>
<Tab title="النشر عبر CLI">
أضف المتغيرات إلى ملف `.env` المحلي قبل تشغيل `crewai deploy create`.
سينقلها CLI بأمان إلى المنصة:
```bash
# .env
OPENAI_API_KEY=sk-...
UV_INDEX_MY_PRIVATE_REGISTRY_USERNAME=token
UV_INDEX_MY_PRIVATE_REGISTRY_PASSWORD=your-pat-here
```
```bash
crewai deploy create
```
</Tab>
</Tabs>
<Warning>
**لا ترفع** أبداً بيانات الاعتماد إلى مستودعك. استخدم متغيرات بيئة AMP لجميع الأسرار.
يجب إدراج ملف `.env` في `.gitignore`.
</Warning>
لتحديث بيانات الاعتماد في نشر حالي، راجع [تحديث طاقمك — متغيرات البيئة](/ar/enterprise/guides/update-crew).
## كيف يعمل الكل معاً
عندما يبني CrewAI AMP أتمتتك، يعمل تدفق الحل هكذا:
<Steps>
<Step title="بدء البناء">
يسحب AMP مستودعك ويقرأ `pyproject.toml` و`uv.lock`.
</Step>
<Step title="UV يحل الاعتماديات">
يقرأ UV `[tool.uv.sources]` لتحديد أي فهرس يجب أن تأتي منه كل حزمة.
</Step>
<Step title="UV يصادق">
لكل فهرس خاص، يبحث UV عن `UV_INDEX_{NAME}_USERNAME` و`UV_INDEX_{NAME}_PASSWORD`
من متغيرات البيئة التي هيأتها في AMP.
</Step>
<Step title="تثبيت الحزم">
يحمّل UV ويثبّت جميع الحزم — العامة (من PyPI) والخاصة (من سجلك).
</Step>
<Step title="تشغيل الأتمتة">
يبدأ طاقمك أو تدفقك مع توفر جميع الاعتماديات.
</Step>
</Steps>
## استكشاف الأخطاء وإصلاحها
### أخطاء المصادقة أثناء البناء
**العرض**: فشل البناء بـ `401 Unauthorized` أو `403 Forbidden` عند حل حزمة خاصة.
**تحقق من**:
- أسماء متغيرات البيئة `UV_INDEX_*` تتطابق مع اسم فهرسك بالضبط (أحرف كبيرة، شرطات → شرطات سفلية)
- بيانات الاعتماد معيّنة في متغيرات بيئة AMP، وليس فقط في `.env` محلي
- الرمز/PAT لديه صلاحيات القراءة المطلوبة لخلاصة الحزم
- الرمز لم تنتهِ صلاحيته (ذو صلة خاصة لـ AWS CodeArtifact)
### الحزمة غير موجودة
**العرض**: `No matching distribution found for my-private-package`.
**تحقق من**:
- رابط الفهرس في `pyproject.toml` ينتهي بـ `/simple/`
- إدخال `[tool.uv.sources]` يعيّن اسم الحزمة الصحيح لاسم الفهرس الصحيح
- الحزمة منشورة فعلاً في سجلك الخاص
- شغّل `uv lock` محلياً بنفس بيانات الاعتماد للتحقق من عمل الحل
### تعارضات ملف القفل
**العرض**: فشل `uv lock` أو نتائج غير متوقعة بعد إضافة فهرس خاص.
**الحل**: عيّن بيانات الاعتماد محلياً وأعد الإنشاء:
```bash
export UV_INDEX_MY_PRIVATE_REGISTRY_USERNAME=token
export UV_INDEX_MY_PRIVATE_REGISTRY_PASSWORD=your-pat
uv lock
```
ثم ارفع `uv.lock` المُحدّث.
## أدلة ذات صلة
<CardGroup cols={3}>
<Card title="التحضير للنشر" icon="clipboard-check" href="/ar/enterprise/guides/prepare-for-deployment">
تحقق من بنية المشروع والاعتماديات قبل النشر.
</Card>
<Card title="النشر على AMP" icon="rocket" href="/ar/enterprise/guides/deploy-to-amp">
انشر طاقمك أو تدفقك وهيّئ متغيرات البيئة.
</Card>
<Card title="تحديث طاقمك" icon="arrows-rotate" href="/ar/enterprise/guides/update-crew">
حدّث متغيرات البيئة وادفع التغييرات إلى نشر قائم.
</Card>
</CardGroup>

View File

@@ -0,0 +1,112 @@
---
title: "تصدير مكون React"
description: "تعلم كيفية تصدير ودمج مكونات React من CrewAI AMP في تطبيقاتك"
icon: "react"
mode: "wide"
---
يشرح هذا الدليل كيفية تصدير طواقم CrewAI AMP كمكونات React ودمجها في تطبيقاتك.
## تصدير مكون React
<Steps>
<Step title="تصدير المكون">
انقر على القائمة (ثلاث نقاط على يمين طاقمك المنشور) واختر خيار التصدير واحفظ الملف محلياً. سنستخدم `CrewLead.jsx` في مثالنا.
<Frame>
<img src="/images/enterprise/export-react-component.png" alt="تصدير مكون React" />
</Frame>
</Step>
</Steps>
## إعداد بيئة React
لتشغيل مكون React هذا محلياً، ستحتاج لإعداد بيئة تطوير React ودمج هذا المكون في مشروع React.
<Steps>
<Step title="تثبيت Node.js">
- حمّل وثبّت Node.js من الموقع الرسمي: https://nodejs.org/
- اختر إصدار LTS (الدعم طويل المدى) للاستقرار.
</Step>
<Step title="إنشاء مشروع React جديد">
- افتح Command Prompt أو PowerShell
- انتقل إلى المجلد الذي تريد إنشاء مشروعك فيه
- شغّل الأمر التالي لإنشاء مشروع React جديد:
```bash
npx create-react-app my-crew-app
```
- انتقل إلى مجلد المشروع:
```bash
cd my-crew-app
```
</Step>
<Step title="تثبيت الاعتماديات اللازمة">
```bash
npm install react-dom
```
</Step>
<Step title="إنشاء مكون CrewLead">
- انقل الملف المُحمّل `CrewLead.jsx` إلى مجلد `src` في مشروعك.
</Step>
<Step title="تعديل App.js لاستخدام مكون CrewLead">
- افتح `src/App.js`
- استبدل محتوياته بشيء مثل هذا:
```jsx
import React from 'react';
import CrewLead from './CrewLead';
function App() {
return (
<div className="App">
<CrewLead baseUrl="YOUR_API_BASE_URL" bearerToken="YOUR_BEARER_TOKEN" />
</div>
);
}
export default App;
```
- استبدل `YOUR_API_BASE_URL` و`YOUR_BEARER_TOKEN` بالقيم الفعلية لـ API.
</Step>
<Step title="بدء خادم التطوير">
- في مجلد مشروعك، شغّل:
```bash
npm start
```
- سيبدأ خادم التطوير، ويجب أن يفتح متصفح الويب الافتراضي تلقائياً على `http://localhost:3000`، حيث سترى تطبيق React يعمل.
</Step>
</Steps>
## التخصيص
يمكنك بعد ذلك تخصيص `CrewLead.jsx` لإضافة اللون والعنوان وغيرها.
<Frame>
<img
src="/images/enterprise/customise-react-component.png"
alt="تخصيص مكون React"
/>
</Frame>
<Frame>
<img
src="/images/enterprise/customise-react-component-2.png"
alt="تخصيص مكون React"
/>
</Frame>
## الخطوات التالية
- خصّص تنسيق المكون ليتوافق مع تصميم تطبيقك
- أضف خصائص إضافية للتهيئة
- ادمج مع إدارة حالة تطبيقك
- أضف معالجة الأخطاء وحالات التحميل

View File

@@ -0,0 +1,50 @@
---
title: "مشغل Salesforce"
description: "تشغيل طواقم CrewAI من سير عمل Salesforce لأتمتة CRM"
icon: "salesforce"
mode: "wide"
---
يمكن تشغيل CrewAI AMP من Salesforce لأتمتة سير عمل إدارة علاقات العملاء وتعزيز عمليات المبيعات.
## نظرة عامة
Salesforce هي منصة رائدة لإدارة علاقات العملاء (CRM) تساعد الشركات على تبسيط عمليات المبيعات والخدمة والتسويق. من خلال إعداد مشغلات CrewAI من Salesforce، يمكنك:
- أتمتة تسجيل وتأهيل العملاء المحتملين
- إنشاء مواد مبيعات مخصصة
- تعزيز خدمة العملاء بردود مدعومة بالذكاء الاصطناعي
- تبسيط تحليل البيانات وإعداد التقارير
## عرض توضيحي
<iframe
className="w-full aspect-video rounded-xl"
src="https://www.youtube.com/embed/oJunVqjjfu4"
title="عرض توضيحي لمشغل CrewAI + Salesforce"
frameBorder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
></iframe>
## البدء
لإعداد مشغلات Salesforce:
1. **تواصل مع الدعم**: تواصل مع دعم CrewAI AMP للمساعدة في إعداد مشغل Salesforce
2. **مراجعة المتطلبات**: تأكد من أن لديك صلاحيات Salesforce اللازمة والوصول إلى API
3. **تهيئة الاتصال**: اعمل مع فريق الدعم لإنشاء الاتصال بين CrewAI ومثيل Salesforce الخاص بك
4. **اختبار المشغلات**: تحقق من عمل المشغلات بشكل صحيح مع حالات الاستخدام المحددة
## حالات الاستخدام
سيناريوهات Salesforce + CrewAI الشائعة تشمل:
- **معالجة العملاء المحتملين**: تحليل وتسجيل العملاء المحتملين الوافدين تلقائياً
- **إنشاء العروض**: إنشاء عروض مخصصة بناءً على بيانات الفرص
- **رؤى العملاء**: إنشاء تقارير تحليلية من سجل تفاعلات العملاء
- **أتمتة المتابعة**: إنشاء رسائل متابعة وتوصيات مخصصة
## الخطوات التالية
للحصول على تعليمات الإعداد المفصلة وخيارات التهيئة المتقدمة، يرجى التواصل مع دعم CrewAI AMP الذي يمكنه تقديم إرشادات مخصصة لبيئة Salesforce واحتياجات عملك المحددة.

View File

@@ -0,0 +1,62 @@
---
title: "مشغل Slack"
description: "تشغيل طواقم CrewAI مباشرة من Slack باستخدام أوامر الشرطة المائلة"
icon: "slack"
mode: "wide"
---
يشرح هذا الدليل كيفية بدء طاقم مباشرة من Slack باستخدام مشغلات CrewAI.
## المتطلبات المسبقة
- مشغل CrewAI لـ Slack مُثبّت ومتصل بمساحة عمل Slack
- طاقم واحد على الأقل مُهيأ في CrewAI
## خطوات الإعداد
<Steps>
<Step title="التأكد من إعداد مشغل CrewAI لـ Slack">
في لوحة تحكم CrewAI، انتقل إلى قسم **Triggers**.
<Frame>
<img src="/images/enterprise/slack-integration.png" alt="تكامل CrewAI مع Slack" />
</Frame>
تحقق من أن Slack مدرج ومتصل.
</Step>
<Step title="فتح قناة Slack">
- انتقل إلى القناة التي تريد تشغيل الطاقم منها.
- اكتب أمر الشرطة المائلة "**/kickoff**" لبدء عملية تشغيل الطاقم.
- يجب أن ترى "**Kickoff crew**" تظهر أثناء الكتابة:
<Frame>
<img src="/images/enterprise/kickoff-slack-crew.png" alt="تشغيل الطاقم" />
</Frame>
- اضغط Enter أو اختر خيار "**Kickoff crew**". سيظهر مربع حوار بعنوان "**Kickoff an AI Crew**".
</Step>
<Step title="اختيار الطاقم الذي تريد بدءه">
- في القائمة المنسدلة "**Select of the crews online:**"، اختر الطاقم الذي تريد بدءه.
- في المثال أدناه، تم اختيار "**prep-for-meeting**":
<Frame>
<img src="/images/enterprise/kickoff-slack-crew-dropdown.png" alt="القائمة المنسدلة لتشغيل الطاقم" />
</Frame>
- إذا كان طاقمك يتطلب أي مدخلات، انقر على زر "**Add Inputs**" لتقديمها.
<Note>
زر "**Add Inputs**" معروض في المثال أعلاه لكن لم يُنقر عليه بعد.
</Note>
</Step>
<Step title="النقر على Kickoff والانتظار حتى يكتمل الطاقم">
- بمجرد اختيار الطاقم وإضافة أي مدخلات ضرورية، انقر على "**Kickoff**" لبدء الطاقم.
<Frame>
<img src="/images/enterprise/kickoff-slack-crew-kickoff.png" alt="تشغيل الطاقم" />
</Frame>
- سيبدأ الطاقم بالتنفيذ وسترى النتائج في قناة Slack.
<Frame>
<img src="/images/enterprise/kickoff-slack-crew-results.png" alt="نتائج تشغيل الطاقم" />
</Frame>
</Step>
</Steps>
## نصائح
- تأكد من أن لديك الصلاحيات اللازمة لاستخدام أمر `/kickoff` في مساحة عمل Slack.
- إذا لم تر الطاقم المطلوب في القائمة المنسدلة، تأكد من أنه مُهيأ بشكل صحيح ومتصل في CrewAI.

View File

@@ -0,0 +1,91 @@
---
title: "إدارة الفريق"
description: "تعلم كيفية دعوة وإدارة أعضاء الفريق في مؤسسة CrewAI AMP"
icon: "users"
mode: "wide"
---
بصفتك مسؤولاً عن حساب CrewAI AMP، يمكنك بسهولة دعوة أعضاء جدد للانضمام إلى مؤسستك. يرشدك هذا الدليل خلال العملية خطوة بخطوة.
## دعوة أعضاء الفريق
<Steps>
<Step title="الوصول إلى صفحة الإعدادات">
- سجّل الدخول إلى حساب CrewAI AMP - ابحث عن أيقونة الترس في
الزاوية العلوية اليمنى من لوحة التحكم - انقر على أيقونة الترس للوصول إلى
صفحة **Settings**:
<Frame caption="صفحة الإعدادات">
<img src="/images/enterprise/settings-page.png" alt="صفحة الإعدادات" />
</Frame>
</Step>
<Step title="الانتقال إلى قسم الأعضاء">
- في صفحة الإعدادات، سترى علامة تبويب `Members` - انقر على علامة تبويب `Members`
للوصول إلى صفحة **Members**:
<Frame caption="علامة تبويب الأعضاء">
<img src="/images/enterprise/members-tab.png" alt="علامة تبويب الأعضاء" />
</Frame>
</Step>
<Step title="دعوة أعضاء جدد">
- في قسم الأعضاء، سترى قائمة بالأعضاء الحاليين (بما فيهم
أنت) - حدد موقع حقل إدخال `Email` - أدخل عنوان البريد الإلكتروني للشخص
الذي تريد دعوته - انقر على زر `Invite` لإرسال الدعوة
</Step>
<Step title="التكرار حسب الحاجة">
- يمكنك تكرار هذه العملية لدعوة أعضاء فريق متعددين - سيتلقى كل عضو
مدعو دعوة عبر البريد الإلكتروني للانضمام إلى مؤسستك
</Step>
</Steps>
## إضافة الأدوار
يمكنك إضافة أدوار لأعضاء فريقك للتحكم في وصولهم إلى أجزاء مختلفة من المنصة.
<Steps>
<Step title="الوصول إلى صفحة الإعدادات">
- سجّل الدخول إلى حساب CrewAI AMP - ابحث عن أيقونة الترس في
الزاوية العلوية اليمنى من لوحة التحكم - انقر على أيقونة الترس للوصول إلى
صفحة **Settings**:
<Frame>
<img src="/images/enterprise/settings-page.png" alt="صفحة الإعدادات" />
</Frame>
</Step>
<Step title="الانتقال إلى قسم الأعضاء">
- في صفحة الإعدادات، سترى علامة تبويب `Roles` - انقر على علامة تبويب `Roles`
للوصول إلى صفحة **Roles**.
<Frame>
<img src="/images/enterprise/roles-tab.png" alt="علامة تبويب الأدوار" />
</Frame>
- انقر على زر `Add Role` لإضافة دور جديد. - أدخل
تفاصيل وصلاحيات الدور وانقر على زر `Create Role` لإنشاء
الدور.
<Frame>
<img src="/images/enterprise/add-role-modal.png" alt="نافذة إضافة الدور" />
</Frame>
</Step>
<Step title="إضافة أدوار للأعضاء">
- في قسم الأعضاء، سترى قائمة بالأعضاء الحاليين (بما فيهم
أنت)
<Frame>
<img
src="/images/enterprise/member-accepted-invitation.png"
alt="العضو قبل الدعوة"
/>
</Frame>
- بمجرد قبول العضو للدعوة، يمكنك إضافة دور
له. - عد إلى علامة تبويب `Roles` - انتقل إلى العضو الذي تريد إضافة
دور له وتحت عمود `Role`، انقر على القائمة المنسدلة - اختر الدور
الذي تريد إضافته للعضو - انقر على زر `Update` لحفظ الدور
<Frame>
<img src="/images/enterprise/assign-role.png" alt="إضافة دور للعضو" />
</Frame>
</Step>
</Steps>
## ملاحظات مهمة
- **صلاحيات المسؤول**: فقط المستخدمون ذوو الصلاحيات الإدارية يمكنهم دعوة أعضاء جدد
- **دقة البريد الإلكتروني**: تأكد من صحة عناوين البريد الإلكتروني لأعضاء فريقك
- **قبول الدعوة**: سيحتاج الأعضاء المدعوون لقبول الدعوة للانضمام إلى مؤسستك
- **إشعارات البريد الإلكتروني**: قد ترغب في إعلام أعضاء فريقك بالتحقق من بريدهم الإلكتروني (بما في ذلك مجلدات البريد غير المرغوب) للدعوة
باتباع هذه الخطوات، يمكنك بسهولة توسيع فريقك والتعاون بشكل أكثر فعالية داخل مؤسسة CrewAI AMP.

View File

@@ -0,0 +1,154 @@
---
title: مستودع الأدوات
description: "استخدام مستودع الأدوات لإدارة أدواتك"
icon: "toolbox"
mode: "wide"
---
## نظرة عامة
مستودع الأدوات هو مدير حزم لأدوات CrewAI. يتيح للمستخدمين نشر وتثبيت وإدارة الأدوات التي تتكامل مع طواقم وتدفقات CrewAI.
يمكن أن تكون الأدوات:
- **خاصة**: متاحة فقط داخل مؤسستك (افتراضي)
- **عامة**: متاحة لجميع مستخدمي CrewAI إذا نُشرت بعلامة `--public`
المستودع ليس نظام تحكم في الإصدارات. استخدم Git لتتبع تغييرات الكود وتمكين التعاون.
## المتطلبات المسبقة
قبل استخدام مستودع الأدوات، تأكد من أن لديك:
- حساب [CrewAI AMP](https://app.crewai.com)
- [CrewAI CLI](/ar/concepts/cli#cli) مُثبّت
- uv>=0.5.0 مُثبّت. راجع [كيفية الترقية](https://docs.astral.sh/uv/getting-started/installation/#upgrading-uv)
- [Git](https://git-scm.com) مُثبّت ومُهيأ
- صلاحيات الوصول للنشر أو التثبيت في مؤسسة CrewAI AMP
## تثبيت الأدوات
لتثبيت أداة:
```bash
crewai tool install <tool-name>
```
يثبّت هذا الأداة ويضيفها إلى `pyproject.toml`.
يمكنك استخدام الأداة باستيرادها وإضافتها إلى وكلائك:
```python
from your_tool.tool import YourTool
custom_tool = YourTool()
researcher = Agent(
role='Market Research Analyst',
goal='Provide up-to-date market analysis of the AI industry',
backstory='An expert analyst with a keen eye for market trends.',
tools=[custom_tool],
verbose=True
)
```
## إضافة حزم أخرى بعد تثبيت أداة
بعد تثبيت أداة من مستودع أدوات CrewAI AMP، تحتاج لاستخدام أمر `crewai uv` لإضافة حزم أخرى لمشروعك.
استخدام أوامر `uv` المباشرة سيفشل لأن المصادقة لمستودع الأدوات يتم التعامل معها عبر CLI. باستخدام أمر `crewai uv`، يمكنك إضافة حزم أخرى لمشروعك دون القلق بشأن المصادقة.
يمكن استخدام أي أمر `uv` مع أمر `crewai uv`، مما يجعله أداة قوية لإدارة اعتماديات مشروعك دون عناء إدارة المصادقة عبر متغيرات البيئة أو طرق أخرى.
لنفرض أنك ثبّت أداة مخصصة من مستودع أدوات CrewAI AMP تسمى "my-tool":
```bash
crewai tool install my-tool
```
والآن تريد إضافة حزمة أخرى لمشروعك، يمكنك استخدام الأمر التالي:
```bash
crewai uv add requests
```
أوامر أخرى مثل `uv sync` أو `uv remove` يمكن أيضاً استخدامها مع أمر `crewai uv`:
```bash
crewai uv sync
```
```bash
crewai uv remove requests
```
سيضيف هذا الحزمة لمشروعك ويحدّث `pyproject.toml` وفقاً لذلك.
## إنشاء ونشر الأدوات
لإنشاء مشروع أداة جديد:
```bash
crewai tool create <tool-name>
```
يولّد هذا مشروع أداة مُهيكل محلياً.
بعد إجراء التغييرات، أنشئ مستودع Git وارفع الكود:
```bash
git init
git add .
git commit -m "Initial version"
```
لنشر الأداة:
```bash
crewai tool publish
```
افتراضياً، تُنشر الأدوات كخاصة. لجعل الأداة عامة:
```bash
crewai tool publish --public
```
لمزيد من التفاصيل حول بناء الأدوات، راجع [إنشاء أدواتك الخاصة](/ar/concepts/tools#creating-your-own-tools).
## تحديث الأدوات
لتحديث أداة منشورة:
1. عدّل الأداة محلياً
2. حدّث الإصدار في `pyproject.toml` (مثل من `0.1.0` إلى `0.1.1`)
3. ارفع التغييرات وانشر
```bash
git commit -m "Update version to 0.1.1"
crewai tool publish
```
## حذف الأدوات
لحذف أداة:
1. انتقل إلى [CrewAI AMP](https://app.crewai.com)
2. انتقل إلى **Tools**
3. اختر الأداة
4. انقر على **Delete**
<Warning>
الحذف نهائي. لا يمكن استعادة أو إعادة تثبيت الأدوات المحذوفة.
</Warning>
## فحوصات الأمان
كل إصدار منشور يخضع لفحوصات أمان آلية، ولا يكون متاحاً للتثبيت إلا بعد اجتيازها.
يمكنك التحقق من حالة فحص الأمان للأداة في:
`CrewAI AMP > Tools > Your Tool > Versions`
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للمساعدة في تكامل API أو
استكشاف الأخطاء.
</Card>

View File

@@ -0,0 +1,91 @@
---
title: "تحديث الطاقم"
description: "تحديث طاقم على CrewAI AMP"
icon: "pencil"
mode: "wide"
---
<Note>
بعد نشر طاقمك على CrewAI AMP، قد تحتاج لإجراء تحديثات على
الكود أو إعدادات الأمان أو التهيئة. يشرح هذا الدليل كيفية تنفيذ
عمليات التحديث الشائعة.
</Note>
## لماذا تحديث طاقمك؟
لن يلتقط CrewAI تحديثات GitHub تلقائياً بشكل افتراضي، لذا ستحتاج لتشغيل التحديثات يدوياً، ما لم تكن قد حددت خيار `Auto-update` عند نشر طاقمك.
هناك عدة أسباب قد تدفعك لتحديث نشر طاقمك:
- تريد تحديث الكود بأحدث إيداع دفعته إلى GitHub
- تريد إعادة تعيين رمز الحامل لأسباب أمنية
- تريد تحديث متغيرات البيئة
## 1. تحديث كود طاقمك لأحدث إيداع
عندما تدفع إيداعات جديدة إلى مستودع GitHub وتريد تحديث نشرك:
1. انتقل إلى طاقمك في منصة CrewAI AMP
2. انقر على زر `Re-deploy` في صفحة تفاصيل طاقمك
<Frame>![زر إعادة النشر](/images/enterprise/redeploy-button.png)</Frame>
سيؤدي ذلك إلى تشغيل تحديث يمكنك تتبعه عبر شريط التقدم. سيسحب النظام أحدث كود من مستودعك ويعيد بناء نشرك.
## 2. إعادة تعيين رمز الحامل
إذا كنت تحتاج لإنشاء رمز حامل جديد (مثلاً، إذا كنت تشتبه في أن الرمز الحالي ربما تم اختراقه):
1. انتقل إلى طاقمك في منصة CrewAI AMP
2. ابحث عن قسم `Bearer Token`
3. انقر على زر `Reset` بجانب رمزك الحالي
<Frame>![إعادة تعيين الرمز](/images/enterprise/reset-token.png)</Frame>
<Warning>
إعادة تعيين رمز الحامل ستبطل الرمز السابق فوراً.
تأكد من تحديث أي تطبيقات أو نصوص برمجية تستخدم الرمز القديم.
</Warning>
## 3. تحديث متغيرات البيئة
لتحديث متغيرات البيئة لطاقمك:
1. أولاً ادخل صفحة النشر بالنقر على اسم طاقمك
<Frame>
![زر متغيرات البيئة](/images/enterprise/env-vars-button.png)
</Frame>
2. حدد موقع قسم `Environment Variables` (ستحتاج للنقر على أيقونة `Settings` للوصول إليه)
3. عدّل المتغيرات الحالية أو أضف جديدة في الحقول المتوفرة
4. انقر على زر `Update` بجانب كل متغير تعدّله
<Frame>
![تحديث متغيرات البيئة](/images/enterprise/update-env-vars.png)
</Frame>
5. أخيراً، انقر على زر `Update Deployment` في أسفل الصفحة لتطبيق التغييرات
<Note>
تحديث متغيرات البيئة سيشغّل نشراً جديداً، لكن هذا سيحدّث
فقط تهيئة البيئة وليس الكود نفسه.
</Note>
## بعد التحديث
بعد إجراء أي تحديث:
1. سيعيد النظام بناء وإعادة نشر طاقمك
2. يمكنك مراقبة تقدم النشر في الوقت الفعلي
3. بمجرد الاكتمال، اختبر طاقمك للتأكد من أن التغييرات تعمل كما هو متوقع
<Tip>
إذا واجهت أي مشاكل بعد التحديث، يمكنك عرض سجلات النشر في
المنصة أو التواصل مع الدعم للمساعدة.
</Tip>
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للمساعدة في تحديث طاقمك أو
استكشاف أخطاء النشر.
</Card>

View File

@@ -0,0 +1,157 @@
---
title: "أتمتة Webhook"
description: "أتمتة سير عمل CrewAI AMP باستخدام webhooks مع منصات مثل ActivePieces وZapier وMake.com"
icon: "webhook"
mode: "wide"
---
يتيح لك CrewAI AMP أتمتة سير عملك باستخدام webhooks. ستوجهك هذه المقالة خلال عملية إعداد واستخدام webhooks لبدء تنفيذ طاقمك، مع التركيز على التكامل مع ActivePieces، وهي منصة أتمتة سير العمل مشابهة لـ Zapier وMake.com.
## إعداد Webhooks
<Steps>
<Step title="الوصول إلى واجهة البدء">
- انتقل إلى لوحة تحكم CrewAI AMP
- ابحث عن قسم `/kickoff`، الذي يُستخدم لبدء تنفيذ الطاقم
<Frame>
<img src="/images/enterprise/kickoff-interface.png" alt="واجهة البدء" />
</Frame>
</Step>
<Step title="تكوين محتوى JSON">
في قسم محتوى JSON، ستحتاج إلى تقديم المعلومات التالية:
- **inputs**: كائن JSON يحتوي على:
- `company`: اسم الشركة (مثال: "tesla")
- `product_name`: اسم المنتج (مثال: "crewai")
- `form_response`: نوع الاستجابة (مثال: "financial")
- `icp_description`: وصف موجز لملف العميل المثالي
- `product_description`: وصف قصير للمنتج
- `taskWebhookUrl`، `stepWebhookUrl`، `crewWebhookUrl`: عناوين URL لنقاط نهاية webhook المختلفة (ActivePieces أو Zapier أو Make.com أو منصة أخرى متوافقة)
</Step>
<Step title="التكامل مع ActivePieces">
في هذا المثال سنستخدم ActivePieces. يمكنك استخدام منصات أخرى مثل Zapier وMake.com
للتكامل مع ActivePieces:
1. أنشئ تدفقًا جديدًا في ActivePieces
2. أضف مشغلًا (مثال: جدول `Every Day`)
<Frame>
<img src="/images/enterprise/activepieces-trigger.png" alt="مشغل ActivePieces" />
</Frame>
3. أضف خطوة إجراء HTTP
- عيّن الإجراء إلى `Send HTTP request`
- استخدم `POST` كطريقة
- عيّن عنوان URL إلى نقطة نهاية بدء CrewAI AMP
- أضف الترويسات اللازمة (مثال: `Bearer Token`)
<Frame>
<img src="/images/enterprise/activepieces-headers.png" alt="ترويسات ActivePieces" />
</Frame>
- في النص، ضمّن محتوى JSON كما تم تكوينه في الخطوة 2
<Frame>
<img src="/images/enterprise/activepieces-body.png" alt="نص ActivePieces" />
</Frame>
- سيبدأ الطاقم بعد ذلك في الوقت المحدد مسبقًا.
</Step>
<Step title="إعداد Webhook">
1. أنشئ تدفقًا جديدًا في ActivePieces وسمّه
<Frame>
<img src="/images/enterprise/activepieces-flow.png" alt="تدفق ActivePieces" />
</Frame>
2. أضف خطوة webhook كمشغل:
- اختر `Catch Webhook` كنوع المشغل
- سيولّد هذا عنوان URL فريدًا سيستقبل طلبات HTTP ويشغل تدفقك
<Frame>
<img src="/images/enterprise/activepieces-webhook.png" alt="Webhook ActivePieces" />
</Frame>
- كوّن البريد الإلكتروني لاستخدام نص جسم webhook الخاص بالطاقم
<Frame>
<img src="/images/enterprise/activepieces-email.png" alt="بريد ActivePieces الإلكتروني" />
</Frame>
</Step>
</Steps>
## أمثلة مخرجات Webhook
**ملاحظة:** أي كائن `meta` مُقدم في طلب البدء الخاص بك سيتم تضمينه في جميع حمولات webhook، مما يتيح لك تتبع الطلبات والحفاظ على السياق عبر دورة حياة تنفيذ الطاقم بالكامل.
<Tabs>
<Tab title="Step Webhook">
`stepWebhookUrl` - رد نداء يتم تنفيذه عند كل فكرة داخلية للوكيل
```json
{
"prompt": "Research the financial industry for potential AI solutions",
"thought": "I need to conduct preliminary research on the financial industry",
"tool": "research_tool",
"tool_input": "financial industry AI solutions",
"result": "**Preliminary Research Report on the Financial Industry for crewai Enterprise Solution**\n1. Industry Overview and Trends\nThe financial industry in ....\nConclusion:\nThe financial industry presents a fertile ground for implementing AI solutions like crewai, particularly in areas such as digital customer engagement, risk management, and regulatory compliance. Further engagement with the lead is recommended to better tailor the crewai solution to their specific needs and scale.",
"kickoff_id": "97eba64f-958c-40a0-b61c-625fe635a3c0",
"meta": {
"requestId": "travel-req-123",
"source": "web-app"
}
}
```
</Tab>
<Tab title="Task Webhook">
`taskWebhookUrl` - رد نداء يتم تنفيذه عند انتهاء كل مهمة
```json
{
"description": "Using the information gathered from the lead's data, conduct preliminary research on the lead's industry, company background, and potential use cases for crewai. Focus on finding relevant data that can aid in scoring the lead and planning a strategy to pitch them crewai.",
"name": "Industry Research Task",
"expected_output": "Detailed research report on the financial industry",
"summary": "The financial industry presents a fertile ground for implementing AI solutions like crewai, particularly in areas such as digital customer engagement, risk management, and regulatory compliance. Further engagement with the lead is recommended to better tailor the crewai solution to their specific needs and scale.",
"agent": "Research Agent",
"output": "**Preliminary Research Report on the Financial Industry for crewai Enterprise Solution**\n1. Industry Overview and Trends\nThe financial industry in ....\nConclusion:\nThe financial industry presents a fertile ground for implementing AI solutions like crewai, particularly in areas such as digital customer engagement, risk management, and regulatory compliance.",
"output_json": {
"industry": "financial",
"key_opportunities": ["digital customer engagement", "risk management", "regulatory compliance"]
},
"kickoff_id": "97eba64f-958c-40a0-b61c-625fe635a3c0",
"meta": {
"requestId": "travel-req-123",
"source": "web-app"
}
}
```
</Tab>
<Tab title="Crew Webhook">
`crewWebhookUrl` - رد نداء يتم تنفيذه عند انتهاء تنفيذ الطاقم
```json
{
"kickoff_id": "97eba64f-958c-40a0-b61c-625fe635a3c0",
"result": "**Final Analysis Report**\n\nLead Score: Customer service enhancement and compliance are particularly relevant.\n\nTalking Points:\n- Highlight how crewai's AI solutions can transform customer service\n- Discuss crewai's potential for sustainability goals\n- Emphasize compliance capabilities\n- Stress adaptability for various operation scales",
"result_json": {
"lead_score": "Customer service enhancement, and compliance are particularly relevant.",
"talking_points": [
"Highlight how crewai's AI solutions can transform customer service with automated, personalized experiences and 24/7 support, improving both customer satisfaction and operational efficiency.",
"Discuss crewai's potential to help the institution achieve its sustainability goals through better data analysis and decision-making, contributing to responsible investing and green initiatives.",
"Emphasize crewai's ability to enhance compliance with evolving regulations through efficient data processing and reporting, reducing the risk of non-compliance penalties.",
"Stress the adaptability of crewai to support both extensive multinational operations and smaller, targeted projects, ensuring the solution grows with the institution's needs."
]
},
"token_usage": {
"total_tokens": 1250,
"prompt_tokens": 800,
"completion_tokens": 450
},
"meta": {
"requestId": "travel-req-123",
"source": "web-app"
}
}
```
</Tab>
</Tabs>

View File

@@ -0,0 +1,105 @@
---
title: "مشغل Zapier"
description: "تشغيل أطقم CrewAI من سير عمل Zapier لأتمتة سير العمل عبر التطبيقات"
icon: "bolt"
mode: "wide"
---
سيرشدك هذا الدليل خلال عملية إعداد مشغلات Zapier لـ CrewAI AMP، مما يتيح لك أتمتة سير العمل بين CrewAI AMP والتطبيقات الأخرى.
## المتطلبات الأساسية
- حساب CrewAI AMP
- حساب Zapier
- حساب Slack (لهذا المثال المحدد)
## الإعداد خطوة بخطوة
<Steps>
<Step title="إعداد مشغل Slack">
- في Zapier، أنشئ Zap جديدًا.
<Frame>
<img src="/images/enterprise/zapier-1.png" alt="Zapier 1" />
</Frame>
</Step>
<Step title="اختر Slack كتطبيق المشغل">
<Frame>
<img src="/images/enterprise/zapier-2.png" alt="Zapier 2" />
</Frame>
- اختر `New Pushed Message` كحدث المشغل.
- اربط حساب Slack الخاص بك إذا لم تفعل ذلك بالفعل.
</Step>
<Step title="تكوين إجراء CrewAI AMP">
- أضف خطوة إجراء جديدة إلى Zap الخاص بك.
- اختر CrewAI+ كتطبيق الإجراء وKickoff كحدث الإجراء
<Frame>
<img src="/images/enterprise/zapier-3.png" alt="Zapier 5" />
</Frame>
</Step>
<Step title="ربط حساب CrewAI AMP">
- اربط حساب CrewAI AMP الخاص بك.
- اختر الطاقم المناسب لسير عملك.
<Frame>
<img src="/images/enterprise/zapier-4.png" alt="Zapier 6" />
</Frame>
- كوّن مدخلات الطاقم باستخدام البيانات من رسالة Slack.
</Step>
<Step title="تنسيق مخرجات CrewAI AMP">
- أضف خطوة إجراء أخرى لتنسيق مخرجات النص من CrewAI AMP.
- استخدم أدوات التنسيق في Zapier لتحويل مخرجات Markdown إلى HTML.
<Frame>
<img src="/images/enterprise/zapier-5.png" alt="Zapier 8" />
</Frame>
<Frame>
<img src="/images/enterprise/zapier-6.png" alt="Zapier 9" />
</Frame>
</Step>
<Step title="إرسال المخرجات عبر البريد الإلكتروني">
- أضف خطوة إجراء نهائية لإرسال المخرجات المنسقة عبر البريد الإلكتروني.
- اختر خدمة البريد الإلكتروني المفضلة لديك (مثال: Gmail، Outlook).
- كوّن تفاصيل البريد الإلكتروني، بما في ذلك المستلم والموضوع والنص.
- أدرج مخرجات CrewAI AMP المنسقة في نص البريد الإلكتروني.
<Frame>
<img src="/images/enterprise/zapier-7.png" alt="Zapier 7" />
</Frame>
</Step>
<Step title="بدء تشغيل الطاقم من Slack">
- أدخل النص في قناة Slack الخاصة بك
<Frame>
<img src="/images/enterprise/zapier-7b.png" alt="Zapier 10" />
</Frame>
- اختر زر النقاط الثلاث ثم اختر Push to Zapier
<Frame>
<img src="/images/enterprise/zapier-8.png" alt="Zapier 11" />
</Frame>
</Step>
<Step title="اختر الطاقم ثم اضغط Push للبدء">
<Frame>
<img src="/images/enterprise/zapier-9.png" alt="Zapier 12" />
</Frame>
</Step>
</Steps>
## نصائح للنجاح
- تأكد من أن مدخلات CrewAI AMP مربوطة بشكل صحيح من رسالة Slack.
- اختبر Zap الخاص بك جيدًا قبل تفعيله لاكتشاف أي مشاكل محتملة.
- فكر في إضافة خطوات معالجة الأخطاء لإدارة حالات الفشل المحتملة في سير العمل.
باتباع هذه الخطوات، ستكون قد أعددت بنجاح مشغلات Zapier لـ CrewAI AMP، مما يتيح سير عمل آلي يتم تشغيله بواسطة رسائل Slack وينتج عنه إشعارات بالبريد الإلكتروني مع مخرجات CrewAI AMP.

View File

@@ -0,0 +1,271 @@
---
title: تكامل Asana
description: "تنسيق مهام الفريق والمشاريع مع تكامل Asana لـ CrewAI."
icon: "circle"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إدارة المهام والمشاريع وتنسيق الفريق عبر Asana. أنشئ المهام وحدّث حالة المشروع وأدر التعيينات وبسّط سير عمل فريقك مع الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Asana، تأكد من أن لديك:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك نشط
- حساب Asana مع الأذونات المناسبة
- ربط حساب Asana الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Asana
### 1. ربط حساب Asana الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Asana** في قسم تكاملات المصادقة
3. انقر على **ربط** وأكمل تدفق OAuth
4. امنح الأذونات اللازمة لإدارة المهام والمشاريع
5. انسخ رمز Enterprise الخاص بك من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز Enterprise الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="asana/create_comment">
**الوصف:** إنشاء تعليق في Asana.
**المعاملات:**
- `task` (string, مطلوب): معرف المهمة - معرف المهمة التي سيُضاف إليها التعليق. سيُنسب التعليق للمستخدم المصادق عليه حاليًا.
- `text` (string, مطلوب): النص (مثال: "This is a comment.").
</Accordion>
<Accordion title="asana/create_project">
**الوصف:** إنشاء مشروع في Asana.
**المعاملات:**
- `name` (string, مطلوب): الاسم (مثال: "Stuff to buy").
- `workspace` (string, مطلوب): مساحة العمل - استخدم إعدادات سير عمل بوابة الاتصال للسماح للمستخدمين باختيار مساحة العمل لإنشاء المشاريع فيها. الافتراضي هو أول مساحة عمل للمستخدم إذا تُرك فارغًا.
- `team` (string, اختياري): الفريق - استخدم إعدادات سير عمل بوابة الاتصال للسماح للمستخدمين باختيار الفريق لمشاركة هذا المشروع معه. الافتراضي هو أول فريق للمستخدم إذا تُرك فارغًا.
- `notes` (string, اختياري): ملاحظات (مثال: "These are things we need to purchase.").
</Accordion>
<Accordion title="asana/get_projects">
**الوصف:** الحصول على قائمة المشاريع في Asana.
**المعاملات:**
- `archived` (string, اختياري): مؤرشف - اختر "true" لعرض المشاريع المؤرشفة، "false" لعرض المشاريع النشطة فقط، أو "default" لعرض كليهما.
- الخيارات: `default`, `true`, `false`
</Accordion>
<Accordion title="asana/get_project_by_id">
**الوصف:** الحصول على مشروع بواسطة المعرف في Asana.
**المعاملات:**
- `projectFilterId` (string, مطلوب): معرف المشروع.
</Accordion>
<Accordion title="asana/create_task">
**الوصف:** إنشاء مهمة في Asana.
**المعاملات:**
- `name` (string, مطلوب): الاسم (مثال: "Task Name").
- `workspace` (string, اختياري): مساحة العمل - استخدم إعدادات سير عمل بوابة الاتصال للسماح للمستخدمين باختيار مساحة العمل لإنشاء المهام فيها. الافتراضي هو أول مساحة عمل للمستخدم إذا تُرك فارغًا.
- `project` (string, اختياري): المشروع - استخدم إعدادات سير عمل بوابة الاتصال للسماح للمستخدمين باختيار المشروع لإنشاء هذه المهمة فيه.
- `notes` (string, اختياري): ملاحظات.
- `dueOnDate` (string, اختياري): تاريخ الاستحقاق - التاريخ الذي تستحق فيه هذه المهمة. لا يمكن استخدامه مع Due At. (مثال: "YYYY-MM-DD").
- `dueAtDate` (string, اختياري): الاستحقاق في - التاريخ والوقت (طابع زمني ISO) الذي تستحق فيه هذه المهمة. لا يمكن استخدامه مع Due On. (مثال: "2019-09-15T02:06:58.147Z").
- `assignee` (string, اختياري): المُكلف - معرف مستخدم Asana الذي سيتم تعيين هذه المهمة له. استخدم إعدادات سير عمل بوابة الاتصال للسماح للمستخدمين باختيار المُكلف.
- `gid` (string, اختياري): معرف خارجي - معرف من تطبيقك لربط هذه المهمة به. يمكنك استخدام هذا المعرف لمزامنة التحديثات لهذه المهمة لاحقًا.
</Accordion>
<Accordion title="asana/update_task">
**الوصف:** تحديث مهمة في Asana.
**المعاملات:**
- `taskId` (string, مطلوب): معرف المهمة - معرف المهمة التي سيتم تحديثها.
- `completeStatus` (string, اختياري): حالة الإكمال.
- الخيارات: `true`, `false`
- `name` (string, اختياري): الاسم (مثال: "Task Name").
- `notes` (string, اختياري): ملاحظات.
- `dueOnDate` (string, اختياري): تاريخ الاستحقاق - التاريخ الذي تستحق فيه هذه المهمة. لا يمكن استخدامه مع Due At. (مثال: "YYYY-MM-DD").
- `dueAtDate` (string, اختياري): الاستحقاق في - التاريخ والوقت (طابع زمني ISO) الذي تستحق فيه هذه المهمة. لا يمكن استخدامه مع Due On. (مثال: "2019-09-15T02:06:58.147Z").
- `assignee` (string, اختياري): المُكلف - معرف مستخدم Asana الذي سيتم تعيين هذه المهمة له.
- `gid` (string, اختياري): معرف خارجي - معرف من تطبيقك لربط هذه المهمة به.
</Accordion>
<Accordion title="asana/get_tasks">
**الوصف:** الحصول على قائمة المهام في Asana.
**المعاملات:**
- `workspace` (string, اختياري): مساحة العمل - معرف مساحة العمل لتصفية المهام عليها.
- `project` (string, اختياري): المشروع - معرف المشروع لتصفية المهام عليه.
- `assignee` (string, اختياري): المُكلف - معرف المُكلف لتصفية المهام عليه.
- `completedSince` (string, اختياري): مكتملة منذ - إرجاع المهام غير المكتملة فقط أو التي اكتملت منذ هذا الوقت (طابع زمني ISO أو Unix). (مثال: "2014-04-25T16:15:47-04:00").
</Accordion>
<Accordion title="asana/get_tasks_by_id">
**الوصف:** الحصول على قائمة المهام بواسطة المعرف في Asana.
**المعاملات:**
- `taskId` (string, مطلوب): معرف المهمة.
</Accordion>
<Accordion title="asana/get_task_by_external_id">
**الوصف:** الحصول على مهمة بواسطة المعرف الخارجي في Asana.
**المعاملات:**
- `gid` (string, مطلوب): المعرف الخارجي - المعرف الذي ترتبط أو تتزامن به هذه المهمة، من تطبيقك.
</Accordion>
<Accordion title="asana/add_task_to_section">
**الوصف:** إضافة مهمة إلى قسم في Asana.
**المعاملات:**
- `sectionId` (string, مطلوب): معرف القسم - معرف القسم لإضافة هذه المهمة إليه.
- `taskId` (string, مطلوب): معرف المهمة - معرف المهمة. (مثال: "1204619611402340").
- `beforeTaskId` (string, اختياري): معرف المهمة السابقة - معرف مهمة في هذا القسم سيتم إدراج هذه المهمة قبلها. لا يمكن استخدامه مع After Task ID. (مثال: "1204619611402340").
- `afterTaskId` (string, اختياري): معرف المهمة التالية - معرف مهمة في هذا القسم سيتم إدراج هذه المهمة بعدها. لا يمكن استخدامه مع Before Task ID. (مثال: "1204619611402340").
</Accordion>
<Accordion title="asana/get_teams">
**الوصف:** الحصول على قائمة الفرق في Asana.
**المعاملات:**
- `workspace` (string, مطلوب): مساحة العمل - إرجاع الفرق في مساحة العمل هذه المرئية للمستخدم المصرح له.
</Accordion>
<Accordion title="asana/get_workspaces">
**الوصف:** الحصول على قائمة مساحات العمل في Asana.
**المعاملات:** لا توجد معاملات مطلوبة.
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد وكيل Asana الأساسي
```python
from crewai import Agent, Task, Crew
# Create an agent with Asana capabilities
asana_agent = Agent(
role="Project Manager",
goal="Manage tasks and projects in Asana efficiently",
backstory="An AI assistant specialized in project management and task coordination.",
apps=['asana'] # All Asana actions will be available
)
# Task to create a new project
create_project_task = Task(
description="Create a new project called 'Q1 Marketing Campaign' in the Marketing workspace",
agent=asana_agent,
expected_output="Confirmation that the project was created successfully with project ID"
)
# Run the task
crew = Crew(
agents=[asana_agent],
tasks=[create_project_task]
)
crew.kickoff()
```
### تصفية أدوات Asana محددة
```python
from crewai import Agent, Task, Crew
# Create agent with specific Asana actions only
task_manager_agent = Agent(
role="Task Manager",
goal="Create and manage tasks efficiently",
backstory="An AI assistant that focuses on task creation and management.",
apps=[
'asana/create_task',
'asana/update_task',
'asana/get_tasks'
] # Specific Asana actions
)
# Task to create and assign a task
task_management = Task(
description="Create a task called 'Review quarterly reports' and assign it to the appropriate team member",
agent=task_manager_agent,
expected_output="Task created and assigned successfully"
)
crew = Crew(
agents=[task_manager_agent],
tasks=[task_management]
)
crew.kickoff()
```
### إدارة المشاريع المتقدمة
```python
from crewai import Agent, Task, Crew
project_coordinator = Agent(
role="Project Coordinator",
goal="Coordinate project activities and track progress",
backstory="An experienced project coordinator who ensures projects run smoothly.",
apps=['asana']
)
# Complex task involving multiple Asana operations
coordination_task = Task(
description="""
1. Get all active projects in the workspace
2. For each project, get the list of incomplete tasks
3. Create a summary report task in the 'Management Reports' project
4. Add comments to overdue tasks to request status updates
""",
agent=project_coordinator,
expected_output="Summary report created and status update requests sent for overdue tasks"
)
crew = Crew(
agents=[project_coordinator],
tasks=[coordination_task]
)
crew.kickoff()
```

View File

@@ -0,0 +1,280 @@
---
title: تكامل Box
description: "تخزين الملفات وإدارة المستندات مع تكامل Box لـ CrewAI."
icon: "box"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إدارة الملفات والمجلدات والمستندات عبر Box. ارفع الملفات، ونظّم هياكل المجلدات، وابحث في المحتوى، وبسّط إدارة مستندات فريقك باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Box، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Box بالصلاحيات المناسبة
- ربط حساب Box الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Box
### 1. ربط حساب Box الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Box** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة لإدارة الملفات والمجلدات
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="box/save_file">
**الوصف:** حفظ ملف من عنوان URL في Box.
**المعاملات:**
- `fileAttributes` (object, مطلوب): السمات - بيانات وصفية للملف تشمل الاسم والمجلد الأصلي والطوابع الزمنية.
```json
{
"content_created_at": "2012-12-12T10:53:43-08:00",
"content_modified_at": "2012-12-12T10:53:43-08:00",
"name": "qwerty.png",
"parent": { "id": "1234567" }
}
```
- `file` (string, مطلوب): عنوان URL للملف - يجب أن يكون حجم الملفات أقل من 50 ميجابايت. (مثال: "https://picsum.photos/200/300").
</Accordion>
<Accordion title="box/save_file_from_object">
**الوصف:** حفظ ملف في Box.
**المعاملات:**
- `file` (string, مطلوب): الملف - يقبل كائن ملف يحتوي على بيانات الملف. يجب أن يكون حجم الملفات أقل من 50 ميجابايت.
- `fileName` (string, مطلوب): اسم الملف (مثال: "qwerty.png").
- `folder` (string, اختياري): المجلد - استخدم إعدادات سير عمل بوابة الاتصال للسماح للمستخدمين باختيار وجهة مجلد الملف. يستخدم المجلد الجذري افتراضياً إذا تُرك فارغاً.
</Accordion>
<Accordion title="box/get_file_by_id">
**الوصف:** الحصول على ملف بواسطة المعرّف في Box.
**المعاملات:**
- `fileId` (string, مطلوب): معرّف الملف - المعرّف الفريد الذي يمثل ملفاً. (مثال: "12345").
</Accordion>
<Accordion title="box/list_files">
**الوصف:** عرض قائمة الملفات في Box.
**المعاملات:**
- `folderId` (string, مطلوب): معرّف المجلد - المعرّف الفريد الذي يمثل مجلداً. (مثال: "0").
- `filterFormula` (object, اختياري): فلتر بصيغة التعبير العادي المنفصل - OR لمجموعات AND من شروط فردية.
```json
{
"operator": "OR",
"conditions": [
{
"operator": "AND",
"conditions": [
{
"field": "direction",
"operator": "$stringExactlyMatches",
"value": "ASC"
}
]
}
]
}
```
</Accordion>
<Accordion title="box/create_folder">
**الوصف:** إنشاء مجلد في Box.
**المعاملات:**
- `folderName` (string, مطلوب): الاسم - اسم المجلد الجديد. (مثال: "New Folder").
- `folderParent` (object, مطلوب): المجلد الأصلي - المجلد الأصلي الذي سيُنشأ فيه المجلد الجديد.
```json
{
"id": "123456"
}
```
</Accordion>
<Accordion title="box/move_folder">
**الوصف:** نقل مجلد في Box.
**المعاملات:**
- `folderId` (string, مطلوب): معرّف المجلد - المعرّف الفريد الذي يمثل مجلداً. (مثال: "0").
- `folderName` (string, مطلوب): الاسم - اسم المجلد. (مثال: "New Folder").
- `folderParent` (object, مطلوب): المجلد الأصلي - وجهة المجلد الأصلي الجديد.
```json
{
"id": "123456"
}
```
</Accordion>
<Accordion title="box/get_folder_by_id">
**الوصف:** الحصول على مجلد بواسطة المعرّف في Box.
**المعاملات:**
- `folderId` (string, مطلوب): معرّف المجلد - المعرّف الفريد الذي يمثل مجلداً. (مثال: "0").
</Accordion>
<Accordion title="box/search_folders">
**الوصف:** البحث في المجلدات في Box.
**المعاملات:**
- `folderId` (string, مطلوب): معرّف المجلد - المجلد المراد البحث فيه.
- `filterFormula` (object, اختياري): فلتر بصيغة التعبير العادي المنفصل - OR لمجموعات AND من شروط فردية.
```json
{
"operator": "OR",
"conditions": [
{
"operator": "AND",
"conditions": [
{
"field": "sort",
"operator": "$stringExactlyMatches",
"value": "name"
}
]
}
]
}
```
</Accordion>
<Accordion title="box/delete_folder">
**الوصف:** حذف مجلد في Box.
**المعاملات:**
- `folderId` (string, مطلوب): معرّف المجلد - المعرّف الفريد الذي يمثل مجلداً. (مثال: "0").
- `recursive` (boolean, اختياري): تكراري - حذف مجلد غير فارغ بحذف المجلد وجميع محتوياته تكرارياً.
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ Box
```python
from crewai import Agent, Task, Crew
from crewai import Agent, Task, Crew
# Create an agent with Box capabilities
box_agent = Agent(
role="Document Manager",
goal="Manage files and folders in Box efficiently",
backstory="An AI assistant specialized in document management and file organization.",
apps=['box'] # All Box actions will be available
)
# Task to create a folder structure
create_structure_task = Task(
description="Create a folder called 'Project Files' in the root directory and upload a document from URL",
agent=box_agent,
expected_output="Folder created and file uploaded successfully"
)
# Run the task
crew = Crew(
agents=[box_agent],
tasks=[create_structure_task]
)
crew.kickoff()
```
### تصفية أدوات Box محددة
```python
from crewai import Agent, Task, Crew
# Create agent with specific Box actions only
file_organizer_agent = Agent(
role="File Organizer",
goal="Organize and manage file storage efficiently",
backstory="An AI assistant that focuses on file organization and storage management.",
apps=['box/create_folder', 'box/save_file', 'box/list_files'] # Specific Box actions
)
# Task to organize files
organization_task = Task(
description="Create a folder structure for the marketing team and organize existing files",
agent=file_organizer_agent,
expected_output="Folder structure created and files organized"
)
crew = Crew(
agents=[file_organizer_agent],
tasks=[organization_task]
)
crew.kickoff()
```
### إدارة الملفات المتقدمة
```python
from crewai import Agent, Task, Crew
file_manager = Agent(
role="File Manager",
goal="Maintain organized file structure and manage document lifecycle",
backstory="An experienced file manager who ensures documents are properly organized and accessible.",
apps=['box']
)
# Complex task involving multiple Box operations
management_task = Task(
description="""
1. List all files in the root folder
2. Create monthly archive folders for the current year
3. Move old files to appropriate archive folders
4. Generate a summary report of the file organization
""",
agent=file_manager,
expected_output="Files organized into archive structure with summary report"
)
crew = Crew(
agents=[file_manager],
tasks=[management_task]
)
crew.kickoff()
```

View File

@@ -0,0 +1,301 @@
---
title: تكامل ClickUp
description: "إدارة المهام والإنتاجية مع تكامل ClickUp لـ CrewAI."
icon: "list-check"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إدارة المهام والمشاريع وسير عمل الإنتاجية عبر ClickUp. أنشئ المهام وحدّثها، ونظّم المشاريع، وأدر تعيينات الفريق، وبسّط إدارة إنتاجيتك باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل ClickUp، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب ClickUp بالصلاحيات المناسبة
- ربط حساب ClickUp الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل ClickUp
### 1. ربط حساب ClickUp الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **ClickUp** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة لإدارة المهام والمشاريع
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="clickup/search_tasks">
**الوصف:** البحث عن المهام في ClickUp باستخدام فلاتر متقدمة.
**المعاملات:**
- `taskFilterFormula` (object, اختياري): فلتر بصيغة التعبير العادي المنفصل - OR لمجموعات AND من شروط فردية.
```json
{
"operator": "OR",
"conditions": [
{
"operator": "AND",
"conditions": [
{
"field": "statuses%5B%5D",
"operator": "$stringExactlyMatches",
"value": "open"
}
]
}
]
}
```
الحقول المتاحة: `space_ids%5B%5D`, `project_ids%5B%5D`, `list_ids%5B%5D`, `statuses%5B%5D`, `include_closed`, `assignees%5B%5D`, `tags%5B%5D`, `due_date_gt`, `due_date_lt`, `date_created_gt`, `date_created_lt`, `date_updated_gt`, `date_updated_lt`
</Accordion>
<Accordion title="clickup/get_task_in_list">
**الوصف:** الحصول على المهام في قائمة محددة في ClickUp.
**المعاملات:**
- `listId` (string, مطلوب): القائمة - اختر قائمة للحصول على المهام منها. استخدم إعدادات المستخدم في بوابة الاتصال للسماح للمستخدمين باختيار قائمة ClickUp.
- `taskFilterFormula` (string, اختياري): البحث عن المهام التي تطابق الفلاتر المحددة. مثال: name=task1.
</Accordion>
<Accordion title="clickup/create_task">
**الوصف:** إنشاء مهمة في ClickUp.
**المعاملات:**
- `listId` (string, مطلوب): القائمة - اختر قائمة لإنشاء هذه المهمة فيها.
- `name` (string, مطلوب): الاسم - اسم المهمة.
- `description` (string, اختياري): الوصف - وصف المهمة.
- `status` (string, اختياري): الحالة - اختر حالة لهذه المهمة.
- `assignees` (string, اختياري): المكلّفون - اختر عضواً (أو مصفوفة من معرّفات الأعضاء) ليتم تعيينهم لهذه المهمة.
- `dueDate` (string, اختياري): تاريخ الاستحقاق - حدد تاريخ استحقاق لهذه المهمة.
- `additionalFields` (string, اختياري): حقول إضافية - حدد حقولاً إضافية لتضمينها في هذه المهمة بصيغة JSON.
</Accordion>
<Accordion title="clickup/update_task">
**الوصف:** تحديث مهمة في ClickUp.
**المعاملات:**
- `taskId` (string, مطلوب): معرّف المهمة - معرّف المهمة المراد تحديثها.
- `listId` (string, مطلوب): القائمة - اختر قائمة لإنشاء هذه المهمة فيها.
- `name` (string, اختياري): الاسم - اسم المهمة.
- `description` (string, اختياري): الوصف - وصف المهمة.
- `status` (string, اختياري): الحالة - اختر حالة لهذه المهمة.
- `assignees` (string, اختياري): المكلّفون - اختر عضواً (أو مصفوفة من معرّفات الأعضاء) ليتم تعيينهم لهذه المهمة.
- `dueDate` (string, اختياري): تاريخ الاستحقاق - حدد تاريخ استحقاق لهذه المهمة.
- `additionalFields` (string, اختياري): حقول إضافية - حدد حقولاً إضافية لتضمينها في هذه المهمة بصيغة JSON.
</Accordion>
<Accordion title="clickup/delete_task">
**الوصف:** حذف مهمة في ClickUp.
**المعاملات:**
- `taskId` (string, مطلوب): معرّف المهمة - معرّف المهمة المراد حذفها.
</Accordion>
<Accordion title="clickup/get_list">
**الوصف:** الحصول على معلومات القائمة في ClickUp.
**المعاملات:**
- `spaceId` (string, مطلوب): معرّف المساحة - معرّف المساحة التي تحتوي على القوائم.
</Accordion>
<Accordion title="clickup/get_custom_fields_in_list">
**الوصف:** الحصول على الحقول المخصصة في قائمة في ClickUp.
**المعاملات:**
- `listId` (string, مطلوب): معرّف القائمة - معرّف القائمة للحصول على الحقول المخصصة منها.
</Accordion>
<Accordion title="clickup/get_all_fields_in_list">
**الوصف:** الحصول على جميع الحقول في قائمة في ClickUp.
**المعاملات:**
- `listId` (string, مطلوب): معرّف القائمة - معرّف القائمة للحصول على جميع الحقول منها.
</Accordion>
<Accordion title="clickup/get_space">
**الوصف:** الحصول على معلومات المساحة في ClickUp.
**المعاملات:**
- `spaceId` (string, اختياري): معرّف المساحة - معرّف المساحة المراد استرجاعها.
</Accordion>
<Accordion title="clickup/get_folders">
**الوصف:** الحصول على المجلدات في ClickUp.
**المعاملات:**
- `spaceId` (string, مطلوب): معرّف المساحة - معرّف المساحة التي تحتوي على المجلدات.
</Accordion>
<Accordion title="clickup/get_member">
**الوصف:** الحصول على معلومات العضو في ClickUp.
**المعاملات:** لا توجد معاملات مطلوبة.
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ ClickUp
```python
from crewai import Agent, Task, Crew
from crewai import Agent, Task, Crew
# Create an agent with Clickup capabilities
clickup_agent = Agent(
role="Task Manager",
goal="Manage tasks and projects in ClickUp efficiently",
backstory="An AI assistant specialized in task management and productivity coordination.",
apps=['clickup'] # All Clickup actions will be available
)
# Task to create a new task
create_task = Task(
description="Create a task called 'Review Q1 Reports' in the Marketing list with high priority",
agent=clickup_agent,
expected_output="Task created successfully with task ID"
)
# Run the task
crew = Crew(
agents=[clickup_agent],
tasks=[create_task]
)
crew.kickoff()
```
### تصفية أدوات ClickUp محددة
```python
task_coordinator = Agent(
role="Task Coordinator",
goal="Create and manage tasks efficiently",
backstory="An AI assistant that focuses on task creation and status management.",
apps=['clickup/create_task']
)
# Task to manage task workflow
task_workflow = Task(
description="Create a task for project planning and assign it to the development team",
agent=task_coordinator,
expected_output="Task created and assigned successfully"
)
crew = Crew(
agents=[task_coordinator],
tasks=[task_workflow]
)
crew.kickoff()
```
### إدارة المشاريع المتقدمة
```python
from crewai import Agent, Task, Crew
project_manager = Agent(
role="Project Manager",
goal="Coordinate project activities and track team productivity",
backstory="An experienced project manager who ensures projects are delivered on time.",
apps=['clickup']
)
# Complex task involving multiple ClickUp operations
project_coordination = Task(
description="""
1. Get all open tasks in the current space
2. Identify overdue tasks and update their status
3. Create a weekly report task summarizing project progress
4. Assign the report task to the team lead
""",
agent=project_manager,
expected_output="Project status updated and weekly report task created and assigned"
)
crew = Crew(
agents=[project_manager],
tasks=[project_coordination]
)
crew.kickoff()
```
### البحث في المهام وإدارتها
```python
from crewai import Agent, Task, Crew
task_analyst = Agent(
role="Task Analyst",
goal="Analyze task patterns and optimize team productivity",
backstory="An AI assistant that analyzes task data to improve team efficiency.",
apps=['clickup']
)
# Task to analyze and optimize task distribution
task_analysis = Task(
description="""
Search for all tasks assigned to team members in the last 30 days,
analyze completion patterns, and create optimization recommendations
""",
agent=task_analyst,
expected_output="Task analysis report with optimization recommendations"
)
crew = Crew(
agents=[task_analyst],
tasks=[task_analysis]
)
crew.kickoff()
```
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل ClickUp أو
استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,330 @@
---
title: تكامل GitHub
description: "إدارة المستودعات والمشكلات مع تكامل GitHub لـ CrewAI."
icon: "github"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إدارة المستودعات والمشكلات والإصدارات عبر GitHub. أنشئ المشكلات وحدّثها، وأدر الإصدارات، وتتبع تطور المشاريع، وبسّط سير عمل تطوير البرمجيات باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل GitHub، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب GitHub بصلاحيات المستودع المناسبة
- ربط حساب GitHub الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل GitHub
### 1. ربط حساب GitHub الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **GitHub** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة لإدارة المستودعات والمشكلات
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="github/create_issue">
**الوصف:** إنشاء مشكلة في GitHub.
**المعاملات:**
- `owner` (string, مطلوب): المالك - حدد اسم مالك الحساب للمستودع المرتبط بهذه المشكلة. (مثال: "abc").
- `repo` (string, مطلوب): المستودع - حدد اسم المستودع المرتبط بهذه المشكلة.
- `title` (string, مطلوب): عنوان المشكلة - حدد عنوان المشكلة المراد إنشاؤها.
- `body` (string, اختياري): محتوى المشكلة - حدد محتوى نص المشكلة المراد إنشاؤها.
- `assignees` (string, اختياري): المكلّفون - حدد اسم (أسماء) تسجيل الدخول في GitHub للمكلّفين كمصفوفة من السلاسل النصية لهذه المشكلة. (مثال: `["octocat"]`).
</Accordion>
<Accordion title="github/update_issue">
**الوصف:** تحديث مشكلة في GitHub.
**المعاملات:**
- `owner` (string, مطلوب): المالك - حدد اسم مالك الحساب للمستودع المرتبط بهذه المشكلة. (مثال: "abc").
- `repo` (string, مطلوب): المستودع - حدد اسم المستودع المرتبط بهذه المشكلة.
- `issue_number` (string, مطلوب): رقم المشكلة - حدد رقم المشكلة المراد تحديثها.
- `title` (string, مطلوب): عنوان المشكلة - حدد عنوان المشكلة المراد تحديثها.
- `body` (string, اختياري): محتوى المشكلة - حدد محتوى نص المشكلة المراد تحديثها.
- `assignees` (string, اختياري): المكلّفون - حدد اسم (أسماء) تسجيل الدخول في GitHub للمكلّفين كمصفوفة من السلاسل النصية لهذه المشكلة. (مثال: `["octocat"]`).
- `state` (string, اختياري): الحالة - حدد الحالة المحدّثة للمشكلة.
- الخيارات: `open`, `closed`
</Accordion>
<Accordion title="github/get_issue_by_number">
**الوصف:** الحصول على مشكلة بواسطة الرقم في GitHub.
**المعاملات:**
- `owner` (string, مطلوب): المالك - حدد اسم مالك الحساب للمستودع المرتبط بهذه المشكلة. (مثال: "abc").
- `repo` (string, مطلوب): المستودع - حدد اسم المستودع المرتبط بهذه المشكلة.
- `issue_number` (string, مطلوب): رقم المشكلة - حدد رقم المشكلة المراد جلبها.
</Accordion>
<Accordion title="github/lock_issue">
**الوصف:** قفل مشكلة في GitHub.
**المعاملات:**
- `owner` (string, مطلوب): المالك - حدد اسم مالك الحساب للمستودع المرتبط بهذه المشكلة. (مثال: "abc").
- `repo` (string, مطلوب): المستودع - حدد اسم المستودع المرتبط بهذه المشكلة.
- `issue_number` (string, مطلوب): رقم المشكلة - حدد رقم المشكلة المراد قفلها.
- `lock_reason` (string, مطلوب): سبب القفل - حدد سبب قفل محادثة المشكلة أو طلب السحب.
- الخيارات: `off-topic`, `too heated`, `resolved`, `spam`
</Accordion>
<Accordion title="github/search_issue">
**الوصف:** البحث عن المشكلات في GitHub.
**المعاملات:**
- `owner` (string, مطلوب): المالك - حدد اسم مالك الحساب للمستودع المرتبط بهذه المشكلة. (مثال: "abc").
- `repo` (string, مطلوب): المستودع - حدد اسم المستودع المرتبط بهذه المشكلة.
- `filter` (object, مطلوب): فلتر بصيغة التعبير العادي المنفصل - OR لمجموعات AND من شروط فردية.
```json
{
"operator": "OR",
"conditions": [
{
"operator": "AND",
"conditions": [
{
"field": "assignee",
"operator": "$stringExactlyMatches",
"value": "octocat"
}
]
}
]
}
```
الحقول المتاحة: `assignee`, `creator`, `mentioned`, `labels`
</Accordion>
<Accordion title="github/create_release">
**الوصف:** إنشاء إصدار في GitHub.
**المعاملات:**
- `owner` (string, مطلوب): المالك - حدد اسم مالك الحساب للمستودع المرتبط بهذا الإصدار. (مثال: "abc").
- `repo` (string, مطلوب): المستودع - حدد اسم المستودع المرتبط بهذا الإصدار.
- `tag_name` (string, مطلوب): الاسم - حدد اسم وسم الإصدار المراد إنشاؤه. (مثال: "v1.0.0").
- `target_commitish` (string, اختياري): الهدف - حدد هدف الإصدار. يمكن أن يكون اسم فرع أو SHA لعملية إيداع. الافتراضي هو الفرع الرئيسي. (مثال: "master").
- `body` (string, اختياري): المحتوى - حدد وصفاً لهذا الإصدار.
- `draft` (string, اختياري): مسودة - حدد ما إذا كان الإصدار المُنشأ يجب أن يكون مسودة (غير منشور).
- الخيارات: `true`, `false`
- `prerelease` (string, اختياري): إصدار تجريبي - حدد ما إذا كان الإصدار المُنشأ يجب أن يكون إصداراً تجريبياً.
- الخيارات: `true`, `false`
- `discussion_category_name` (string, اختياري): اسم فئة المناقشة - إذا حُدد، يتم إنشاء مناقشة من الفئة المحددة وربطها بالإصدار.
- `generate_release_notes` (string, اختياري): ملاحظات الإصدار - حدد ما إذا كان يجب إنشاء ملاحظات الإصدار تلقائياً.
- الخيارات: `true`, `false`
</Accordion>
<Accordion title="github/update_release">
**الوصف:** تحديث إصدار في GitHub.
**المعاملات:**
- `owner` (string, مطلوب): المالك - حدد اسم مالك الحساب للمستودع المرتبط بهذا الإصدار. (مثال: "abc").
- `repo` (string, مطلوب): المستودع - حدد اسم المستودع المرتبط بهذا الإصدار.
- `id` (string, مطلوب): معرّف الإصدار - حدد معرّف الإصدار المراد تحديثه.
- `tag_name` (string, اختياري): الاسم - حدد اسم وسم الإصدار المراد تحديثه. (مثال: "v1.0.0").
- `target_commitish` (string, اختياري): الهدف - حدد هدف الإصدار. يمكن أن يكون اسم فرع أو SHA لعملية إيداع. الافتراضي هو الفرع الرئيسي. (مثال: "master").
- `body` (string, اختياري): المحتوى - حدد وصفاً لهذا الإصدار.
- `draft` (string, اختياري): مسودة - حدد ما إذا كان الإصدار يجب أن يكون مسودة (غير منشور).
- الخيارات: `true`, `false`
- `prerelease` (string, اختياري): إصدار تجريبي - حدد ما إذا كان الإصدار يجب أن يكون إصداراً تجريبياً.
- الخيارات: `true`, `false`
- `discussion_category_name` (string, اختياري): اسم فئة المناقشة - إذا حُدد، يتم إنشاء مناقشة من الفئة المحددة وربطها بالإصدار.
- `generate_release_notes` (string, اختياري): ملاحظات الإصدار - حدد ما إذا كان يجب إنشاء ملاحظات الإصدار تلقائياً.
- الخيارات: `true`, `false`
</Accordion>
<Accordion title="github/get_release_by_id">
**الوصف:** الحصول على إصدار بواسطة المعرّف في GitHub.
**المعاملات:**
- `owner` (string, مطلوب): المالك - حدد اسم مالك الحساب للمستودع المرتبط بهذا الإصدار. (مثال: "abc").
- `repo` (string, مطلوب): المستودع - حدد اسم المستودع المرتبط بهذا الإصدار.
- `id` (string, مطلوب): معرّف الإصدار - حدد معرّف الإصدار المراد جلبه.
</Accordion>
<Accordion title="github/get_release_by_tag_name">
**الوصف:** الحصول على إصدار بواسطة اسم الوسم في GitHub.
**المعاملات:**
- `owner` (string, مطلوب): المالك - حدد اسم مالك الحساب للمستودع المرتبط بهذا الإصدار. (مثال: "abc").
- `repo` (string, مطلوب): المستودع - حدد اسم المستودع المرتبط بهذا الإصدار.
- `tag_name` (string, مطلوب): الاسم - حدد وسم الإصدار المراد جلبه. (مثال: "v1.0.0").
</Accordion>
<Accordion title="github/delete_release">
**الوصف:** حذف إصدار في GitHub.
**المعاملات:**
- `owner` (string, مطلوب): المالك - حدد اسم مالك الحساب للمستودع المرتبط بهذا الإصدار. (مثال: "abc").
- `repo` (string, مطلوب): المستودع - حدد اسم المستودع المرتبط بهذا الإصدار.
- `id` (string, مطلوب): معرّف الإصدار - حدد معرّف الإصدار المراد حذفه.
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ GitHub
```python
from crewai import Agent, Task, Crew
from crewai import Agent, Task, Crew
# Create an agent with Github capabilities
github_agent = Agent(
role="Repository Manager",
goal="Manage GitHub repositories, issues, and releases efficiently",
backstory="An AI assistant specialized in repository management and issue tracking.",
apps=['github'] # All Github actions will be available
)
# Task to create a new issue
create_issue_task = Task(
description="Create a bug report issue for the login functionality in the main repository",
agent=github_agent,
expected_output="Issue created successfully with issue number"
)
# Run the task
crew = Crew(
agents=[github_agent],
tasks=[create_issue_task]
)
crew.kickoff()
```
### تصفية أدوات GitHub محددة
```python
issue_manager = Agent(
role="Issue Manager",
goal="Create and manage GitHub issues efficiently",
backstory="An AI assistant that focuses on issue tracking and management.",
apps=['github/create_issue']
)
# Task to manage issue workflow
issue_workflow = Task(
description="Create a feature request issue and assign it to the development team",
agent=issue_manager,
expected_output="Feature request issue created and assigned successfully"
)
crew = Crew(
agents=[issue_manager],
tasks=[issue_workflow]
)
crew.kickoff()
```
### إدارة الإصدارات
```python
from crewai import Agent, Task, Crew
release_manager = Agent(
role="Release Manager",
goal="Manage software releases and versioning",
backstory="An experienced release manager who handles version control and release processes.",
apps=['github']
)
# Task to create a new release
release_task = Task(
description="""
Create a new release v2.1.0 for the project with:
- Auto-generated release notes
- Target the main branch
- Include a description of new features and bug fixes
""",
agent=release_manager,
expected_output="Release v2.1.0 created successfully with release notes"
)
crew = Crew(
agents=[release_manager],
tasks=[release_task]
)
crew.kickoff()
```
### تتبع المشكلات وإدارتها
```python
from crewai import Agent, Task, Crew
project_coordinator = Agent(
role="Project Coordinator",
goal="Track and coordinate project issues and development progress",
backstory="An AI assistant that helps coordinate development work and track project progress.",
apps=['github']
)
# Complex task involving multiple GitHub operations
coordination_task = Task(
description="""
1. Search for all open issues assigned to the current milestone
2. Identify overdue issues and update their priority labels
3. Create a weekly progress report issue
4. Lock resolved issues that have been inactive for 30 days
""",
agent=project_coordinator,
expected_output="Project coordination completed with progress report and issue management"
)
crew = Crew(
agents=[project_coordinator],
tasks=[coordination_task]
)
crew.kickoff()
```
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل GitHub أو
استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,302 @@
---
title: تكامل Gmail
description: "إدارة البريد الإلكتروني وجهات الاتصال مع تكامل Gmail لـ CrewAI."
icon: "envelope"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إدارة رسائل البريد الإلكتروني وجهات الاتصال والمسودات عبر Gmail. أرسل رسائل البريد الإلكتروني، وابحث في الرسائل، وأدر جهات الاتصال، وأنشئ المسودات، وبسّط اتصالات البريد الإلكتروني باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Gmail، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Gmail بالصلاحيات المناسبة
- ربط حساب Gmail الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Gmail
### 1. ربط حساب Gmail الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Gmail** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة لإدارة البريد الإلكتروني وجهات الاتصال
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="gmail/fetch_emails">
**الوصف:** استرجاع قائمة بالرسائل.
**المعاملات:**
- `userId` (string, مطلوب): عنوان البريد الإلكتروني للمستخدم أو 'me' للمستخدم المصادق عليه. (الافتراضي: "me")
- `q` (string, اختياري): استعلام بحث لتصفية الرسائل (مثال: 'from:someone@example.com is:unread').
- `maxResults` (integer, اختياري): الحد الأقصى لعدد الرسائل المُرجعة (1-500). (الافتراضي: 100)
- `pageToken` (string, اختياري): رمز الصفحة لاسترجاع صفحة محددة من النتائج.
- `labelIds` (array, اختياري): إرجاع الرسائل ذات التصنيفات التي تطابق جميع معرّفات التصنيف المحددة فقط.
- `includeSpamTrash` (boolean, اختياري): تضمين رسائل البريد العشوائي والمحذوفات في النتائج. (الافتراضي: false)
</Accordion>
<Accordion title="gmail/send_email">
**الوصف:** إرسال بريد إلكتروني.
**المعاملات:**
- `to` (string, مطلوب): عنوان البريد الإلكتروني للمستلم.
- `subject` (string, مطلوب): سطر موضوع البريد الإلكتروني.
- `body` (string, مطلوب): محتوى رسالة البريد الإلكتروني.
- `userId` (string, اختياري): عنوان البريد الإلكتروني للمستخدم أو 'me' للمستخدم المصادق عليه. (الافتراضي: "me")
- `cc` (string, اختياري): عناوين نسخة كربونية (مفصولة بفواصل).
- `bcc` (string, اختياري): عناوين نسخة كربونية مخفية (مفصولة بفواصل).
- `from` (string, اختياري): عنوان المرسل (إذا كان مختلفاً عن المستخدم المصادق عليه).
- `replyTo` (string, اختياري): عنوان الرد.
- `threadId` (string, اختياري): معرّف السلسلة إذا كان الرد على محادثة موجودة.
</Accordion>
<Accordion title="gmail/delete_email">
**الوصف:** حذف بريد إلكتروني بواسطة المعرّف.
**المعاملات:**
- `userId` (string, مطلوب): عنوان البريد الإلكتروني للمستخدم أو 'me' للمستخدم المصادق عليه.
- `id` (string, مطلوب): معرّف الرسالة المراد حذفها.
</Accordion>
<Accordion title="gmail/create_draft">
**الوصف:** إنشاء مسودة بريد إلكتروني جديدة.
**المعاملات:**
- `userId` (string, مطلوب): عنوان البريد الإلكتروني للمستخدم أو 'me' للمستخدم المصادق عليه.
- `message` (object, مطلوب): كائن الرسالة الذي يحتوي على محتوى المسودة.
- `raw` (string, مطلوب): رسالة البريد الإلكتروني بترميز base64url.
</Accordion>
<Accordion title="gmail/get_message">
**الوصف:** استرجاع رسالة محددة بواسطة المعرّف.
**المعاملات:**
- `userId` (string, مطلوب): عنوان البريد الإلكتروني للمستخدم أو 'me' للمستخدم المصادق عليه. (الافتراضي: "me")
- `id` (string, مطلوب): معرّف الرسالة المراد استرجاعها.
- `format` (string, اختياري): صيغة إرجاع الرسالة. الخيارات: "full", "metadata", "minimal", "raw". (الافتراضي: "full")
- `metadataHeaders` (array, اختياري): عند التحديد وكانت الصيغة METADATA، يتم تضمين الترويسات المحددة فقط.
</Accordion>
<Accordion title="gmail/get_attachment">
**الوصف:** استرجاع مرفق رسالة.
**المعاملات:**
- `userId` (string, مطلوب): عنوان البريد الإلكتروني للمستخدم أو 'me' للمستخدم المصادق عليه. (الافتراضي: "me")
- `messageId` (string, مطلوب): معرّف الرسالة التي تحتوي على المرفق.
- `id` (string, مطلوب): معرّف المرفق المراد استرجاعه.
</Accordion>
<Accordion title="gmail/fetch_thread">
**الوصف:** استرجاع سلسلة بريد إلكتروني محددة بواسطة المعرّف.
**المعاملات:**
- `userId` (string, مطلوب): عنوان البريد الإلكتروني للمستخدم أو 'me' للمستخدم المصادق عليه. (الافتراضي: "me")
- `id` (string, مطلوب): معرّف السلسلة المراد استرجاعها.
- `format` (string, اختياري): صيغة إرجاع الرسائل. الخيارات: "full", "metadata", "minimal". (الافتراضي: "full")
- `metadataHeaders` (array, اختياري): عند التحديد وكانت الصيغة METADATA، يتم تضمين الترويسات المحددة فقط.
</Accordion>
<Accordion title="gmail/modify_thread">
**الوصف:** تعديل التصنيفات المُطبقة على سلسلة.
**المعاملات:**
- `userId` (string, مطلوب): عنوان البريد الإلكتروني للمستخدم أو 'me' للمستخدم المصادق عليه. (الافتراضي: "me")
- `id` (string, مطلوب): معرّف السلسلة المراد تعديلها.
- `addLabelIds` (array, اختياري): قائمة بمعرّفات التصنيفات المراد إضافتها لهذه السلسلة.
- `removeLabelIds` (array, اختياري): قائمة بمعرّفات التصنيفات المراد إزالتها من هذه السلسلة.
</Accordion>
<Accordion title="gmail/trash_thread">
**الوصف:** نقل سلسلة إلى سلة المحذوفات.
**المعاملات:**
- `userId` (string, مطلوب): عنوان البريد الإلكتروني للمستخدم أو 'me' للمستخدم المصادق عليه. (الافتراضي: "me")
- `id` (string, مطلوب): معرّف السلسلة المراد حذفها.
</Accordion>
<Accordion title="gmail/untrash_thread">
**الوصف:** إزالة سلسلة من سلة المحذوفات.
**المعاملات:**
- `userId` (string, مطلوب): عنوان البريد الإلكتروني للمستخدم أو 'me' للمستخدم المصادق عليه. (الافتراضي: "me")
- `id` (string, مطلوب): معرّف السلسلة المراد استعادتها.
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ Gmail
```python
from crewai import Agent, Task, Crew
# Create an agent with Gmail capabilities
gmail_agent = Agent(
role="Email Manager",
goal="Manage email communications and messages efficiently",
backstory="An AI assistant specialized in email management and communication.",
apps=['gmail'] # All Gmail actions will be available
)
# Task to send a follow-up email
send_email_task = Task(
description="Send a follow-up email to john@example.com about the project update meeting",
agent=gmail_agent,
expected_output="Email sent successfully with confirmation"
)
# Run the task
crew = Crew(
agents=[gmail_agent],
tasks=[send_email_task]
)
crew.kickoff()
```
### تصفية أدوات Gmail محددة
```python
from crewai import Agent, Task, Crew
# Create agent with specific Gmail actions only
email_coordinator = Agent(
role="Email Coordinator",
goal="Coordinate email communications and manage drafts",
backstory="An AI assistant that focuses on email coordination and draft management.",
apps=[
'gmail/send_email',
'gmail/fetch_emails',
'gmail/create_draft'
]
)
# Task to prepare and send emails
email_coordination = Task(
description="Search for emails from the marketing team, create a summary draft, and send it to stakeholders",
agent=email_coordinator,
expected_output="Summary email sent to stakeholders"
)
crew = Crew(
agents=[email_coordinator],
tasks=[email_coordination]
)
crew.kickoff()
```
### البحث في البريد الإلكتروني وتحليله
```python
from crewai import Agent, Task, Crew
# Create agent with Gmail search and analysis capabilities
email_analyst = Agent(
role="Email Analyst",
goal="Analyze email patterns and provide insights",
backstory="An AI assistant that analyzes email data to provide actionable insights.",
apps=['gmail/fetch_emails', 'gmail/get_message'] # Specific actions for email analysis
)
# Task to analyze email patterns
analysis_task = Task(
description="""
Search for all unread emails from the last 7 days,
categorize them by sender domain,
and create a summary report of communication patterns
""",
agent=email_analyst,
expected_output="Email analysis report with communication patterns and recommendations"
)
crew = Crew(
agents=[email_analyst],
tasks=[analysis_task]
)
crew.kickoff()
```
### إدارة السلاسل
```python
from crewai import Agent, Task, Crew
# Create agent with Gmail thread management capabilities
thread_manager = Agent(
role="Thread Manager",
goal="Organize and manage email threads efficiently",
backstory="An AI assistant that specializes in email thread organization and management.",
apps=[
'gmail/fetch_thread',
'gmail/modify_thread',
'gmail/trash_thread'
]
)
# Task to organize email threads
thread_task = Task(
description="""
1. Fetch all threads from the last month
2. Apply appropriate labels to organize threads by project
3. Archive or trash threads that are no longer relevant
""",
agent=thread_manager,
expected_output="Email threads organized with appropriate labels and cleanup completed"
)
crew = Crew(
agents=[thread_manager],
tasks=[thread_task]
)
crew.kickoff()
```
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل Gmail أو
استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,366 @@
---
title: تكامل Google Calendar
description: "إدارة الأحداث والجداول الزمنية مع تكامل Google Calendar لـ CrewAI."
icon: "calendar"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إدارة أحداث التقويم والجداول الزمنية والتوفر عبر Google Calendar. أنشئ الأحداث وحدّثها، وأدر الحضور، وتحقق من التوفر، وبسّط سير عمل الجدولة باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Google Calendar، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Google مع إمكانية الوصول إلى Google Calendar
- ربط حساب Google الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Google Calendar
### 1. ربط حساب Google الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Google Calendar** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة للوصول إلى التقويم
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="google_calendar/get_availability">
**الوصف:** الحصول على توفر التقويم (معلومات مشغول/متاح).
**المعاملات:**
- `timeMin` (string, مطلوب): وقت البداية (بصيغة RFC3339)
- `timeMax` (string, مطلوب): وقت النهاية (بصيغة RFC3339)
- `items` (array, مطلوب): معرّفات التقاويم المراد التحقق منها
```json
[
{
"id": "calendar_id"
}
]
```
- `timeZone` (string, اختياري): المنطقة الزمنية المستخدمة في الاستجابة. الافتراضي هو UTC.
- `groupExpansionMax` (integer, اختياري): الحد الأقصى لعدد معرّفات التقاويم لمجموعة واحدة. الحد الأقصى: 100
- `calendarExpansionMax` (integer, اختياري): الحد الأقصى لعدد التقاويم لتقديم معلومات التوفر. الحد الأقصى: 50
</Accordion>
<Accordion title="google_calendar/create_event">
**الوصف:** إنشاء حدث جديد في التقويم المحدد.
**المعاملات:**
- `calendarId` (string, مطلوب): معرّف التقويم (استخدم 'primary' للتقويم الرئيسي)
- `summary` (string, مطلوب): عنوان/ملخص الحدث
- `start_dateTime` (string, مطلوب): وقت البداية بصيغة RFC3339 (مثال: 2024-01-20T10:00:00-07:00)
- `end_dateTime` (string, مطلوب): وقت النهاية بصيغة RFC3339
- `description` (string, اختياري): وصف الحدث
- `timeZone` (string, اختياري): المنطقة الزمنية (مثال: America/Los_Angeles)
- `location` (string, اختياري): الموقع الجغرافي للحدث كنص حر.
- `attendees` (array, اختياري): قائمة الحضور للحدث.
```json
[
{
"email": "attendee@example.com",
"displayName": "Attendee Name",
"optional": false
}
]
```
- `reminders` (object, اختياري): معلومات حول تذكيرات الحدث.
```json
{
"useDefault": true,
"overrides": [
{
"method": "email",
"minutes": 15
}
]
}
```
- `conferenceData` (object, اختياري): المعلومات المتعلقة بالمؤتمر، مثل تفاصيل مؤتمر Google Meet.
```json
{
"createRequest": {
"requestId": "unique-request-id",
"conferenceSolutionKey": {
"type": "hangoutsMeet"
}
}
}
```
- `visibility` (string, اختياري): ظهور الحدث. الخيارات: default, public, private, confidential. الافتراضي: default
- `transparency` (string, اختياري): ما إذا كان الحدث يحجب الوقت في التقويم. الخيارات: opaque, transparent. الافتراضي: opaque
</Accordion>
<Accordion title="google_calendar/view_events">
**الوصف:** استرجاع الأحداث للتقويم المحدد.
**المعاملات:**
- `calendarId` (string, مطلوب): معرّف التقويم (استخدم 'primary' للتقويم الرئيسي)
- `timeMin` (string, اختياري): الحد الأدنى للأحداث (بصيغة RFC3339)
- `timeMax` (string, اختياري): الحد الأعلى للأحداث (بصيغة RFC3339)
- `maxResults` (integer, اختياري): الحد الأقصى لعدد الأحداث (الافتراضي 10). الحد الأدنى: 1، الحد الأقصى: 2500
- `orderBy` (string, اختياري): ترتيب الأحداث في النتيجة. الخيارات: startTime, updated. الافتراضي: startTime
- `singleEvents` (boolean, اختياري): ما إذا كان يجب توسيع الأحداث المتكررة إلى نُسخ فردية. الافتراضي: true
- `showDeleted` (boolean, اختياري): ما إذا كان يجب تضمين الأحداث المحذوفة. الافتراضي: false
- `showHiddenInvitations` (boolean, اختياري): ما إذا كان يجب تضمين الدعوات المخفية. الافتراضي: false
- `q` (string, اختياري): مصطلحات بحث نصية حرة للعثور على الأحداث المطابقة في أي حقل.
- `pageToken` (string, اختياري): رمز يحدد صفحة النتائج المراد إرجاعها.
- `timeZone` (string, اختياري): المنطقة الزمنية المستخدمة في الاستجابة.
- `updatedMin` (string, اختياري): الحد الأدنى لوقت آخر تعديل للحدث (بصيغة RFC3339) للتصفية.
- `iCalUID` (string, اختياري): يحدد معرّف حدث بصيغة iCalendar ليتم تقديمه في الاستجابة.
</Accordion>
<Accordion title="google_calendar/update_event">
**الوصف:** تحديث حدث موجود.
**المعاملات:**
- `calendarId` (string, مطلوب): معرّف التقويم
- `eventId` (string, مطلوب): معرّف الحدث المراد تحديثه
- `summary` (string, اختياري): عنوان الحدث المحدّث
- `description` (string, اختياري): وصف الحدث المحدّث
- `start_dateTime` (string, اختياري): وقت البداية المحدّث
- `end_dateTime` (string, اختياري): وقت النهاية المحدّث
</Accordion>
<Accordion title="google_calendar/delete_event">
**الوصف:** حذف حدث محدد.
**المعاملات:**
- `calendarId` (string, مطلوب): معرّف التقويم
- `eventId` (string, مطلوب): معرّف الحدث المراد حذفه
</Accordion>
<Accordion title="google_calendar/view_calendar_list">
**الوصف:** استرجاع قائمة تقاويم المستخدم.
**المعاملات:**
- `maxResults` (integer, اختياري): الحد الأقصى لعدد الإدخالات في صفحة نتائج واحدة. الحد الأدنى: 1
- `pageToken` (string, اختياري): رمز يحدد صفحة النتائج المراد إرجاعها.
- `showDeleted` (boolean, اختياري): ما إذا كان يجب تضمين إدخالات قائمة التقويم المحذوفة. الافتراضي: false
- `showHidden` (boolean, اختياري): ما إذا كان يجب عرض الإدخالات المخفية. الافتراضي: false
- `minAccessRole` (string, اختياري): الحد الأدنى لدور الوصول للمستخدم. الخيارات: freeBusyReader, owner, reader, writer
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي للتقويم
```python
from crewai import Agent, Task, Crew
# Create an agent with Google Calendar capabilities
calendar_agent = Agent(
role="Schedule Manager",
goal="Manage calendar events and scheduling efficiently",
backstory="An AI assistant specialized in calendar management and scheduling coordination.",
apps=['google_calendar'] # All Google Calendar actions will be available
)
# Task to create a meeting
create_meeting_task = Task(
description="Create a team standup meeting for tomorrow at 9 AM with the development team",
agent=calendar_agent,
expected_output="Meeting created successfully with Google Meet link"
)
# Run the task
crew = Crew(
agents=[calendar_agent],
tasks=[create_meeting_task]
)
crew.kickoff()
```
### تصفية أدوات التقويم المحددة
```python
meeting_coordinator = Agent(
role="Meeting Coordinator",
goal="Coordinate meetings and check availability",
backstory="An AI assistant that focuses on meeting scheduling and availability management.",
apps=['google_calendar/create_event', 'google_calendar/get_availability']
)
# Task to schedule a meeting with availability check
schedule_meeting = Task(
description="Check availability for next week and schedule a project review meeting with stakeholders",
agent=meeting_coordinator,
expected_output="Meeting scheduled after checking availability of all participants"
)
crew = Crew(
agents=[meeting_coordinator],
tasks=[schedule_meeting]
)
crew.kickoff()
```
### إدارة الأحداث وتحديثاتها
```python
from crewai import Agent, Task, Crew
event_manager = Agent(
role="Event Manager",
goal="Manage and update calendar events efficiently",
backstory="An experienced event manager who handles event logistics and updates.",
apps=['google_calendar']
)
# Task to manage event updates
event_management = Task(
description="""
1. List all events for this week
2. Update any events that need location changes to include video conference links
3. Check availability for upcoming meetings
""",
agent=event_manager,
expected_output="Weekly events updated with proper locations and availability checked"
)
crew = Crew(
agents=[event_manager],
tasks=[event_management]
)
crew.kickoff()
```
### التوفر وإدارة التقويم
```python
from crewai import Agent, Task, Crew
availability_coordinator = Agent(
role="Availability Coordinator",
goal="Coordinate availability and manage calendars for scheduling",
backstory="An AI assistant that specializes in availability management and calendar coordination.",
apps=['google_calendar']
)
# Task to coordinate availability
availability_task = Task(
description="""
1. Get the list of available calendars
2. Check availability for all calendars next Friday afternoon
3. Create a team meeting for the first available 2-hour slot
4. Include Google Meet link and send invitations
""",
agent=availability_coordinator,
expected_output="Team meeting scheduled based on availability with all team members invited"
)
crew = Crew(
agents=[availability_coordinator],
tasks=[availability_task]
)
crew.kickoff()
```
### سير عمل الجدولة الآلية
```python
from crewai import Agent, Task, Crew
scheduling_automator = Agent(
role="Scheduling Automator",
goal="Automate scheduling workflows and calendar management",
backstory="An AI assistant that automates complex scheduling scenarios and calendar workflows.",
apps=['google_calendar']
)
# Complex scheduling automation task
automation_task = Task(
description="""
1. List all upcoming events for the next two weeks
2. Identify any scheduling conflicts or back-to-back meetings
3. Suggest optimal meeting times by checking availability
4. Create buffer time between meetings where needed
5. Update event descriptions with agenda items and meeting links
""",
agent=scheduling_automator,
expected_output="Calendar optimized with resolved conflicts, buffer times, and updated meeting details"
)
crew = Crew(
agents=[scheduling_automator],
tasks=[automation_task]
)
crew.kickoff()
```
## استكشاف الأخطاء وإصلاحها
### المشاكل الشائعة
**أخطاء المصادقة**
- تأكد من أن حساب Google الخاص بك لديه الصلاحيات اللازمة للوصول إلى التقويم
- تحقق من أن اتصال OAuth يتضمن جميع النطاقات المطلوبة لـ Google Calendar API
- تحقق مما إذا كانت إعدادات مشاركة التقويم تسمح بمستوى الوصول المطلوب
**مشاكل إنشاء الأحداث**
- تحقق من صحة صيغ الوقت (صيغة RFC3339)
- تأكد من صحة صيغة عناوين البريد الإلكتروني للحضور
- تحقق من وجود التقويم المستهدف وإمكانية الوصول إليه
- تحقق من صحة تحديد المناطق الزمنية
**التوفر وتعارضات الوقت**
- استخدم صيغة RFC3339 المناسبة لنطاقات الوقت عند التحقق من التوفر
- تأكد من اتساق المناطق الزمنية عبر جميع العمليات
- تحقق من صحة معرّفات التقاويم عند التحقق من تقاويم متعددة
**تحديث الأحداث وحذفها**
- تحقق من صحة معرّفات الأحداث ووجودها
- تأكد من أن لديك صلاحيات التحرير للأحداث
- تحقق من أن ملكية التقويم تسمح بالتعديلات
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل Google Calendar
أو استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,493 @@
---
title: تكامل Google Contacts
description: "إدارة جهات الاتصال والدليل مع تكامل Google Contacts لـ CrewAI."
icon: "address-book"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إدارة جهات الاتصال ومعلومات الدليل عبر Google Contacts. يمكنك الوصول إلى جهات الاتصال الشخصية، والبحث في أشخاص الدليل، وإنشاء معلومات الاتصال وتحديثها، وإدارة مجموعات جهات الاتصال باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Google Contacts، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Google مع إمكانية الوصول إلى Google Contacts
- ربط حساب Google الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Google Contacts
### 1. ربط حساب Google الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Google Contacts** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة للوصول إلى جهات الاتصال والدليل
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="google_contacts/get_contacts">
**الوصف:** استرجاع جهات اتصال المستخدم من Google Contacts.
**المعاملات:**
- `pageSize` (integer, اختياري): عدد جهات الاتصال المراد إرجاعها (الحد الأقصى 1000). الحد الأدنى: 1، الحد الأقصى: 1000
- `pageToken` (string, اختياري): رمز الصفحة المراد استرجاعها.
- `personFields` (string, اختياري): الحقول المراد تضمينها (مثال: 'names,emailAddresses,phoneNumbers'). الافتراضي: names,emailAddresses,phoneNumbers
- `requestSyncToken` (boolean, اختياري): ما إذا كان يجب أن تتضمن الاستجابة رمز مزامنة. الافتراضي: false
- `sortOrder` (string, اختياري): ترتيب الفرز للاتصالات. الخيارات: LAST_MODIFIED_ASCENDING, LAST_MODIFIED_DESCENDING, FIRST_NAME_ASCENDING, LAST_NAME_ASCENDING
</Accordion>
<Accordion title="google_contacts/search_contacts">
**الوصف:** البحث عن جهات اتصال باستخدام سلسلة استعلام.
**المعاملات:**
- `query` (string, مطلوب): سلسلة استعلام البحث
- `readMask` (string, مطلوب): الحقول المراد قراءتها (مثال: 'names,emailAddresses,phoneNumbers')
- `pageSize` (integer, اختياري): عدد النتائج المراد إرجاعها. الحد الأدنى: 1، الحد الأقصى: 30
- `pageToken` (string, اختياري): رمز يحدد صفحة النتائج المراد إرجاعها.
- `sources` (array, اختياري): المصادر المراد البحث فيها. الخيارات: READ_SOURCE_TYPE_CONTACT, READ_SOURCE_TYPE_PROFILE. الافتراضي: READ_SOURCE_TYPE_CONTACT
</Accordion>
<Accordion title="google_contacts/list_directory_people">
**الوصف:** عرض قائمة الأشخاص في دليل المستخدم المصادق عليه.
**المعاملات:**
- `sources` (array, مطلوب): مصادر الدليل المراد البحث فيها. الخيارات: DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE, DIRECTORY_SOURCE_TYPE_DOMAIN_CONTACT. الافتراضي: DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE
- `pageSize` (integer, اختياري): عدد الأشخاص المراد إرجاعهم. الحد الأدنى: 1، الحد الأقصى: 1000
- `pageToken` (string, اختياري): رمز يحدد صفحة النتائج المراد إرجاعها.
- `readMask` (string, اختياري): الحقول المراد قراءتها (مثال: 'names,emailAddresses')
- `requestSyncToken` (boolean, اختياري): ما إذا كان يجب أن تتضمن الاستجابة رمز مزامنة. الافتراضي: false
- `mergeSources` (array, اختياري): بيانات إضافية لدمجها في استجابات أشخاص الدليل. الخيارات: CONTACT
</Accordion>
<Accordion title="google_contacts/search_directory_people">
**الوصف:** البحث عن أشخاص في الدليل.
**المعاملات:**
- `query` (string, مطلوب): استعلام البحث
- `sources` (string, مطلوب): مصادر الدليل (استخدم 'DIRECTORY_SOURCE_TYPE_DOMAIN_PROFILE')
- `pageSize` (integer, اختياري): عدد النتائج المراد إرجاعها
- `readMask` (string, اختياري): الحقول المراد قراءتها
</Accordion>
<Accordion title="google_contacts/list_other_contacts">
**الوصف:** عرض جهات الاتصال الأخرى (غير الموجودة في جهات الاتصال الشخصية).
**المعاملات:**
- `pageSize` (integer, اختياري): عدد جهات الاتصال المراد إرجاعها. الحد الأدنى: 1، الحد الأقصى: 1000
- `pageToken` (string, اختياري): رمز يحدد صفحة النتائج المراد إرجاعها.
- `readMask` (string, اختياري): الحقول المراد قراءتها
- `requestSyncToken` (boolean, اختياري): ما إذا كان يجب أن تتضمن الاستجابة رمز مزامنة. الافتراضي: false
</Accordion>
<Accordion title="google_contacts/search_other_contacts">
**الوصف:** البحث في جهات الاتصال الأخرى.
**المعاملات:**
- `query` (string, مطلوب): استعلام البحث
- `readMask` (string, مطلوب): الحقول المراد قراءتها (مثال: 'names,emailAddresses')
- `pageSize` (integer, اختياري): عدد النتائج
</Accordion>
<Accordion title="google_contacts/get_person">
**الوصف:** الحصول على معلومات الاتصال لشخص واحد بواسطة اسم المورد.
**المعاملات:**
- `resourceName` (string, مطلوب): اسم المورد للشخص المراد الحصول عليه (مثال: 'people/c123456789')
- `personFields` (string, اختياري): الحقول المراد تضمينها (مثال: 'names,emailAddresses,phoneNumbers'). الافتراضي: names,emailAddresses,phoneNumbers
</Accordion>
<Accordion title="google_contacts/create_contact">
**الوصف:** إنشاء جهة اتصال جديدة في دفتر عناوين المستخدم.
**المعاملات:**
- `names` (array, اختياري): أسماء الشخص
```json
[
{
"givenName": "John",
"familyName": "Doe",
"displayName": "John Doe"
}
]
```
- `emailAddresses` (array, اختياري): عناوين البريد الإلكتروني
```json
[
{
"value": "john.doe@example.com",
"type": "work"
}
]
```
- `phoneNumbers` (array, اختياري): أرقام الهاتف
```json
[
{
"value": "+1234567890",
"type": "mobile"
}
]
```
- `addresses` (array, اختياري): العناوين البريدية
```json
[
{
"formattedValue": "123 Main St, City, State 12345",
"type": "home"
}
]
```
- `organizations` (array, اختياري): المؤسسات/الشركات
```json
[
{
"name": "Company Name",
"title": "Job Title",
"type": "work"
}
]
```
</Accordion>
<Accordion title="google_contacts/update_contact">
**الوصف:** تحديث معلومات جهة اتصال موجودة.
**المعاملات:**
- `resourceName` (string, مطلوب): اسم المورد للشخص المراد تحديثه (مثال: 'people/c123456789')
- `updatePersonFields` (string, مطلوب): الحقول المراد تحديثها (مثال: 'names,emailAddresses,phoneNumbers')
- `names` (array, اختياري): أسماء الشخص
- `emailAddresses` (array, اختياري): عناوين البريد الإلكتروني
- `phoneNumbers` (array, اختياري): أرقام الهاتف
</Accordion>
<Accordion title="google_contacts/delete_contact">
**الوصف:** حذف جهة اتصال من دفتر عناوين المستخدم.
**المعاملات:**
- `resourceName` (string, مطلوب): اسم المورد للشخص المراد حذفه (مثال: 'people/c123456789')
</Accordion>
<Accordion title="google_contacts/batch_get_people">
**الوصف:** الحصول على معلومات عن عدة أشخاص في طلب واحد.
**المعاملات:**
- `resourceNames` (array, مطلوب): أسماء موارد الأشخاص المراد الحصول عليهم. الحد الأقصى: 200 عنصر
- `personFields` (string, اختياري): الحقول المراد تضمينها (مثال: 'names,emailAddresses,phoneNumbers'). الافتراضي: names,emailAddresses,phoneNumbers
</Accordion>
<Accordion title="google_contacts/list_contact_groups">
**الوصف:** عرض مجموعات جهات اتصال المستخدم (التصنيفات).
**المعاملات:**
- `pageSize` (integer, اختياري): عدد مجموعات جهات الاتصال المراد إرجاعها. الحد الأدنى: 1، الحد الأقصى: 1000
- `pageToken` (string, اختياري): رمز يحدد صفحة النتائج المراد إرجاعها.
- `groupFields` (string, اختياري): الحقول المراد تضمينها (مثال: 'name,memberCount,clientData'). الافتراضي: name,memberCount
</Accordion>
<Accordion title="google_contacts/get_contact_group">
**الوصف:** الحصول على مجموعة جهات اتصال محددة بواسطة اسم المورد.
**المعاملات:**
- `resourceName` (string, مطلوب): اسم المورد لمجموعة جهات الاتصال (مثال: 'contactGroups/myContactGroup')
- `maxMembers` (integer, اختياري): الحد الأقصى لعدد الأعضاء المراد تضمينهم. الحد الأدنى: 0، الحد الأقصى: 20000
- `groupFields` (string, اختياري): الحقول المراد تضمينها (مثال: 'name,memberCount,clientData'). الافتراضي: name,memberCount
</Accordion>
<Accordion title="google_contacts/create_contact_group">
**الوصف:** إنشاء مجموعة جهات اتصال جديدة (تصنيف).
**المعاملات:**
- `name` (string, مطلوب): اسم مجموعة جهات الاتصال
- `clientData` (array, اختياري): بيانات خاصة بالعميل
```json
[
{
"key": "data_key",
"value": "data_value"
}
]
```
</Accordion>
<Accordion title="google_contacts/update_contact_group">
**الوصف:** تحديث معلومات مجموعة جهات اتصال.
**المعاملات:**
- `resourceName` (string, مطلوب): اسم المورد لمجموعة جهات الاتصال (مثال: 'contactGroups/myContactGroup')
- `name` (string, مطلوب): اسم مجموعة جهات الاتصال
- `clientData` (array, اختياري): بيانات خاصة بالعميل
```json
[
{
"key": "data_key",
"value": "data_value"
}
]
```
</Accordion>
<Accordion title="google_contacts/delete_contact_group">
**الوصف:** حذف مجموعة جهات اتصال.
**المعاملات:**
- `resourceName` (string, مطلوب): اسم المورد لمجموعة جهات الاتصال المراد حذفها (مثال: 'contactGroups/myContactGroup')
- `deleteContacts` (boolean, اختياري): ما إذا كان يجب حذف جهات الاتصال في المجموعة أيضاً. الافتراضي: false
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ Google Contacts
```python
from crewai import Agent, Task, Crew
# Create an agent with Google Contacts capabilities
contacts_agent = Agent(
role="Contact Manager",
goal="Manage contacts and directory information efficiently",
backstory="An AI assistant specialized in contact management and directory operations.",
apps=['google_contacts'] # All Google Contacts actions will be available
)
# Task to retrieve and organize contacts
contact_management_task = Task(
description="Retrieve all contacts and organize them by company affiliation",
agent=contacts_agent,
expected_output="Contacts retrieved and organized by company with summary report"
)
# Run the task
crew = Crew(
agents=[contacts_agent],
tasks=[contact_management_task]
)
crew.kickoff()
```
### البحث في الدليل وإدارته
```python
from crewai import Agent, Task, Crew
directory_manager = Agent(
role="Directory Manager",
goal="Search and manage directory people and contacts",
backstory="An AI assistant that specializes in directory management and people search.",
apps=[
'google_contacts/search_directory_people',
'google_contacts/list_directory_people',
'google_contacts/search_contacts'
]
)
# Task to search and manage directory
directory_task = Task(
description="Search for team members in the company directory and create a team contact list",
agent=directory_manager,
expected_output="Team directory compiled with contact information"
)
crew = Crew(
agents=[directory_manager],
tasks=[directory_task]
)
crew.kickoff()
```
### إنشاء جهات الاتصال وتحديثاتها
```python
from crewai import Agent, Task, Crew
contact_curator = Agent(
role="Contact Curator",
goal="Create and update contact information systematically",
backstory="An AI assistant that maintains accurate and up-to-date contact information.",
apps=['google_contacts']
)
# Task to create and update contacts
curation_task = Task(
description="""
1. Search for existing contacts related to new business partners
2. Create new contacts for partners not in the system
3. Update existing contact information with latest details
4. Organize contacts into appropriate groups
""",
agent=contact_curator,
expected_output="Contact database updated with new partners and organized groups"
)
crew = Crew(
agents=[contact_curator],
tasks=[curation_task]
)
crew.kickoff()
```
### إدارة مجموعات جهات الاتصال
```python
from crewai import Agent, Task, Crew
group_organizer = Agent(
role="Contact Group Organizer",
goal="Organize contacts into meaningful groups and categories",
backstory="An AI assistant that specializes in contact organization and group management.",
apps=['google_contacts']
)
# Task to organize contact groups
organization_task = Task(
description="""
1. List all existing contact groups
2. Analyze contact distribution across groups
3. Create new groups for better organization
4. Move contacts to appropriate groups based on their information
""",
agent=group_organizer,
expected_output="Contacts organized into logical groups with improved structure"
)
crew = Crew(
agents=[group_organizer],
tasks=[organization_task]
)
crew.kickoff()
```
### إدارة جهات الاتصال الشاملة
```python
from crewai import Agent, Task, Crew
contact_specialist = Agent(
role="Contact Management Specialist",
goal="Provide comprehensive contact management across all sources",
backstory="An AI assistant that handles all aspects of contact management including personal, directory, and other contacts.",
apps=['google_contacts']
)
# Complex contact management task
comprehensive_task = Task(
description="""
1. Retrieve contacts from all sources (personal, directory, other)
2. Search for duplicate contacts and merge information
3. Update outdated contact information
4. Create missing contacts for important stakeholders
5. Organize contacts into meaningful groups
6. Generate a comprehensive contact report
""",
agent=contact_specialist,
expected_output="Complete contact management performed with unified contact database and detailed report"
)
crew = Crew(
agents=[contact_specialist],
tasks=[comprehensive_task]
)
crew.kickoff()
```
## استكشاف الأخطاء وإصلاحها
### المشاكل الشائعة
**أخطاء الصلاحيات**
- تأكد من أن حساب Google الخاص بك لديه الصلاحيات المناسبة للوصول إلى جهات الاتصال
- تحقق من أن اتصال OAuth يتضمن النطاقات المطلوبة لـ Google Contacts API
- تحقق من منح صلاحيات الوصول للدليل لجهات اتصال المؤسسة
**مشاكل صيغة اسم المورد**
- تأكد من أن أسماء الموارد تتبع الصيغة الصحيحة (مثال: 'people/c123456789' لجهات الاتصال)
- تحقق من أن أسماء موارد مجموعات جهات الاتصال تستخدم الصيغة 'contactGroups/groupId'
- تأكد من وجود أسماء الموارد وإمكانية الوصول إليها
**مشاكل البحث والاستعلام**
- تأكد من صحة صيغة استعلامات البحث وعدم كونها فارغة
- استخدم حقول readMask المناسبة للبيانات التي تحتاجها
- تحقق من صحة تحديد مصادر البحث (جهات اتصال مقابل ملفات تعريف)
**إنشاء جهات الاتصال وتحديثاتها**
- تأكد من توفير الحقول المطلوبة عند إنشاء جهات الاتصال
- تحقق من صحة صيغة عناوين البريد الإلكتروني وأرقام الهاتف
- تأكد من أن معامل updatePersonFields يتضمن جميع الحقول التي يتم تحديثها
**مشاكل الوصول إلى الدليل**
- تأكد من أن لديك الصلاحيات المناسبة للوصول إلى دليل المؤسسة
- تحقق من صحة تحديد مصادر الدليل
- تأكد من أن مؤسستك تسمح بالوصول عبر API إلى معلومات الدليل
**الترقيم والحدود**
- انتبه لحدود حجم الصفحة (تختلف حسب نقطة النهاية)
- استخدم pageToken للترقيم عبر مجموعات النتائج الكبيرة
- احترم حدود معدل API وطبّق تأخيرات مناسبة
**مجموعات جهات الاتصال والتنظيم**
- تأكد من أن أسماء مجموعات جهات الاتصال فريدة عند إنشاء مجموعات جديدة
- تحقق من وجود جهات الاتصال قبل إضافتها إلى المجموعات
- تأكد من أن لديك صلاحيات تعديل مجموعات جهات الاتصال
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل Google Contacts
أو استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,550 @@
---
title: تكامل Google Docs
description: "إنشاء المستندات وتحريرها مع تكامل Google Docs لـ CrewAI."
icon: "file-lines"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إنشاء وتحرير وإدارة مستندات Google Docs مع معالجة النصوص والتنسيق. أتمت إنشاء المستندات، وأدرج النصوص واستبدلها، وأدر نطاقات المحتوى، وبسّط سير عمل المستندات باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Google Docs، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Google مع إمكانية الوصول إلى Google Docs
- ربط حساب Google الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Google Docs
### 1. ربط حساب Google الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Google Docs** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة للوصول إلى المستندات
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="google_docs/create_document">
**الوصف:** إنشاء مستند Google جديد.
**المعاملات:**
- `title` (string, اختياري): عنوان المستند الجديد.
</Accordion>
<Accordion title="google_docs/get_document">
**الوصف:** الحصول على محتويات وبيانات وصفية لمستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند المراد استرجاعه.
- `includeTabsContent` (boolean, اختياري): ما إذا كان يجب تضمين محتوى علامات التبويب. الافتراضي هو `false`.
- `suggestionsViewMode` (string, اختياري): وضع عرض الاقتراحات المراد تطبيقه. القيم: `DEFAULT_FOR_CURRENT_ACCESS`, `PREVIEW_SUGGESTIONS_ACCEPTED`, `PREVIEW_WITHOUT_SUGGESTIONS`. الافتراضي: `DEFAULT_FOR_CURRENT_ACCESS`.
</Accordion>
<Accordion title="google_docs/batch_update">
**الوصف:** تطبيق تحديث واحد أو أكثر على مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند المراد تحديثه.
- `requests` (array, مطلوب): قائمة بالتحديثات المراد تطبيقها على المستند.
- `writeControl` (object, اختياري): يوفر التحكم في كيفية تنفيذ طلبات الكتابة.
</Accordion>
<Accordion title="google_docs/insert_text">
**الوصف:** إدراج نص في مستند Google في موقع محدد.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند المراد تحديثه.
- `text` (string, مطلوب): النص المراد إدراجه.
- `index` (integer, اختياري): الفهرس القائم على الصفر حيث يتم إدراج النص. الافتراضي هو `1`.
</Accordion>
<Accordion title="google_docs/replace_text">
**الوصف:** استبدال جميع نُسخ النص في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند المراد تحديثه.
- `containsText` (string, مطلوب): النص المراد البحث عنه واستبداله.
- `replaceText` (string, مطلوب): النص البديل.
- `matchCase` (boolean, اختياري): ما إذا كان البحث يجب أن يراعي حالة الأحرف. الافتراضي هو `false`.
</Accordion>
<Accordion title="google_docs/delete_content_range">
**الوصف:** حذف المحتوى من نطاق محدد في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند المراد تحديثه.
- `startIndex` (integer, مطلوب): فهرس بداية النطاق المراد حذفه.
- `endIndex` (integer, مطلوب): فهرس نهاية النطاق المراد حذفه.
</Accordion>
<Accordion title="google_docs/insert_page_break">
**الوصف:** إدراج فاصل صفحة في موقع محدد في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند المراد تحديثه.
- `index` (integer, اختياري): الفهرس القائم على الصفر حيث يتم إدراج فاصل الصفحة. الافتراضي هو `1`.
</Accordion>
<Accordion title="google_docs/create_named_range">
**الوصف:** إنشاء نطاق مسمّى في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند المراد تحديثه.
- `name` (string, مطلوب): اسم النطاق المسمّى.
- `startIndex` (integer, مطلوب): فهرس بداية النطاق.
- `endIndex` (integer, مطلوب): فهرس نهاية النطاق.
</Accordion>
<Accordion title="google_docs/create_document_with_content">
**الوصف:** إنشاء مستند Google جديد مع محتوى في إجراء واحد.
**المعاملات:**
- `title` (string, مطلوب): عنوان المستند الجديد.
- `content` (string, اختياري): المحتوى النصي المراد إدراجه في المستند. استخدم `\n` لفقرات جديدة.
</Accordion>
<Accordion title="google_docs/append_text">
**الوصف:** إلحاق نص بنهاية مستند Google. يُدرج تلقائياً في نهاية المستند دون الحاجة لتحديد فهرس.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `text` (string, مطلوب): النص المراد إلحاقه بنهاية المستند. استخدم `\n` لفقرات جديدة.
</Accordion>
<Accordion title="google_docs/set_text_bold">
**الوصف:** جعل النص غامقاً أو إزالة التنسيق الغامق في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `startIndex` (integer, مطلوب): موضع بداية النص المراد تنسيقه.
- `endIndex` (integer, مطلوب): موضع نهاية النص المراد تنسيقه (حصري).
- `bold` (boolean, مطلوب): عيّن `true` لجعله غامقاً، `false` لإزالة الغامق.
</Accordion>
<Accordion title="google_docs/set_text_italic">
**الوصف:** جعل النص مائلاً أو إزالة التنسيق المائل في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `startIndex` (integer, مطلوب): موضع بداية النص المراد تنسيقه.
- `endIndex` (integer, مطلوب): موضع نهاية النص المراد تنسيقه (حصري).
- `italic` (boolean, مطلوب): عيّن `true` لجعله مائلاً، `false` لإزالة المائل.
</Accordion>
<Accordion title="google_docs/set_text_underline">
**الوصف:** إضافة أو إزالة تنسيق التسطير من النص في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `startIndex` (integer, مطلوب): موضع بداية النص المراد تنسيقه.
- `endIndex` (integer, مطلوب): موضع نهاية النص المراد تنسيقه (حصري).
- `underline` (boolean, مطلوب): عيّن `true` للتسطير، `false` لإزالة التسطير.
</Accordion>
<Accordion title="google_docs/set_text_strikethrough">
**الوصف:** إضافة أو إزالة تنسيق يتوسطه خط من النص في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `startIndex` (integer, مطلوب): موضع بداية النص المراد تنسيقه.
- `endIndex` (integer, مطلوب): موضع نهاية النص المراد تنسيقه (حصري).
- `strikethrough` (boolean, مطلوب): عيّن `true` لإضافة يتوسطه خط، `false` للإزالة.
</Accordion>
<Accordion title="google_docs/set_font_size">
**الوصف:** تغيير حجم خط النص في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `startIndex` (integer, مطلوب): موضع بداية النص المراد تنسيقه.
- `endIndex` (integer, مطلوب): موضع نهاية النص المراد تنسيقه (حصري).
- `fontSize` (number, مطلوب): حجم الخط بالنقاط. الأحجام الشائعة: 10, 11, 12, 14, 16, 18, 24, 36.
</Accordion>
<Accordion title="google_docs/set_text_color">
**الوصف:** تغيير لون النص باستخدام قيم RGB (مقياس 0-1) في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `startIndex` (integer, مطلوب): موضع بداية النص المراد تنسيقه.
- `endIndex` (integer, مطلوب): موضع نهاية النص المراد تنسيقه (حصري).
- `red` (number, مطلوب): مكوّن الأحمر (0-1). مثال: `1` للأحمر الكامل.
- `green` (number, مطلوب): مكوّن الأخضر (0-1). مثال: `0.5` لنصف الأخضر.
- `blue` (number, مطلوب): مكوّن الأزرق (0-1). مثال: `0` لعدم وجود أزرق.
</Accordion>
<Accordion title="google_docs/create_hyperlink">
**الوصف:** تحويل نص موجود إلى رابط قابل للنقر في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `startIndex` (integer, مطلوب): موضع بداية النص المراد تحويله إلى رابط.
- `endIndex` (integer, مطلوب): موضع نهاية النص المراد تحويله إلى رابط (حصري).
- `url` (string, مطلوب): عنوان URL الذي يجب أن يشير إليه الرابط. مثال: `"https://example.com"`.
</Accordion>
<Accordion title="google_docs/apply_heading_style">
**الوصف:** تطبيق نمط عنوان أو فقرة على نطاق نصي في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `startIndex` (integer, مطلوب): موضع بداية الفقرة (الفقرات) المراد تنسيقها.
- `endIndex` (integer, مطلوب): موضع نهاية الفقرة (الفقرات) المراد تنسيقها.
- `style` (string, مطلوب): النمط المراد تطبيقه. القيم: `NORMAL_TEXT`, `TITLE`, `SUBTITLE`, `HEADING_1`, `HEADING_2`, `HEADING_3`, `HEADING_4`, `HEADING_5`, `HEADING_6`.
</Accordion>
<Accordion title="google_docs/set_paragraph_alignment">
**الوصف:** تعيين محاذاة النص للفقرات في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `startIndex` (integer, مطلوب): موضع بداية الفقرة (الفقرات) المراد محاذاتها.
- `endIndex` (integer, مطلوب): موضع نهاية الفقرة (الفقرات) المراد محاذاتها.
- `alignment` (string, مطلوب): محاذاة النص. القيم: `START` (يسار), `CENTER`, `END` (يمين), `JUSTIFIED`.
</Accordion>
<Accordion title="google_docs/set_line_spacing">
**الوصف:** تعيين تباعد الأسطر للفقرات في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `startIndex` (integer, مطلوب): موضع بداية الفقرة (الفقرات).
- `endIndex` (integer, مطلوب): موضع نهاية الفقرة (الفقرات).
- `lineSpacing` (number, مطلوب): تباعد الأسطر كنسبة مئوية. `100` = مفرد، `115` = 1.15x، `150` = 1.5x، `200` = مزدوج.
</Accordion>
<Accordion title="google_docs/create_paragraph_bullets">
**الوصف:** تحويل الفقرات إلى قائمة نقطية أو مرقمة في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `startIndex` (integer, مطلوب): موضع بداية الفقرات المراد تحويلها إلى قائمة.
- `endIndex` (integer, مطلوب): موضع نهاية الفقرات المراد تحويلها إلى قائمة.
- `bulletPreset` (string, مطلوب): نمط النقاط/الترقيم. القيم: `BULLET_DISC_CIRCLE_SQUARE`, `BULLET_DIAMONDX_ARROW3D_SQUARE`, `BULLET_CHECKBOX`, `BULLET_ARROW_DIAMOND_DISC`, `BULLET_STAR_CIRCLE_SQUARE`, `NUMBERED_DECIMAL_ALPHA_ROMAN`, `NUMBERED_DECIMAL_ALPHA_ROMAN_PARENS`, `NUMBERED_DECIMAL_NESTED`, `NUMBERED_UPPERALPHA_ALPHA_ROMAN`, `NUMBERED_UPPERROMAN_UPPERALPHA_DECIMAL`.
</Accordion>
<Accordion title="google_docs/delete_paragraph_bullets">
**الوصف:** إزالة النقاط أو الترقيم من الفقرات في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `startIndex` (integer, مطلوب): موضع بداية فقرات القائمة.
- `endIndex` (integer, مطلوب): موضع نهاية فقرات القائمة.
</Accordion>
<Accordion title="google_docs/insert_table_with_content">
**الوصف:** إدراج جدول مع محتوى في مستند Google في إجراء واحد. قدم المحتوى كمصفوفة ثنائية الأبعاد.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `rows` (integer, مطلوب): عدد الصفوف في الجدول.
- `columns` (integer, مطلوب): عدد الأعمدة في الجدول.
- `index` (integer, اختياري): الموضع لإدراج الجدول. إذا لم يُحدد، يُدرج الجدول في نهاية المستند.
- `content` (array, مطلوب): محتوى الجدول كمصفوفة ثنائية الأبعاد. كل مصفوفة داخلية هي صف. مثال: `[["Year", "Revenue"], ["2023", "$43B"], ["2024", "$45B"]]`.
</Accordion>
<Accordion title="google_docs/insert_table_row">
**الوصف:** إدراج صف جديد فوق أو أسفل خلية مرجعية في جدول موجود.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `tableStartIndex` (integer, مطلوب): فهرس بداية الجدول.
- `rowIndex` (integer, مطلوب): فهرس الصف (قائم على الصفر) للخلية المرجعية.
- `columnIndex` (integer, اختياري): فهرس العمود (قائم على الصفر) للخلية المرجعية. الافتراضي هو `0`.
- `insertBelow` (boolean, اختياري): إذا `true`، يُدرج أسفل الصف المرجعي. إذا `false`، يُدرج فوقه. الافتراضي هو `true`.
</Accordion>
<Accordion title="google_docs/insert_table_column">
**الوصف:** إدراج عمود جديد يساراً أو يميناً لخلية مرجعية في جدول موجود.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `tableStartIndex` (integer, مطلوب): فهرس بداية الجدول.
- `rowIndex` (integer, اختياري): فهرس الصف (قائم على الصفر) للخلية المرجعية. الافتراضي هو `0`.
- `columnIndex` (integer, مطلوب): فهرس العمود (قائم على الصفر) للخلية المرجعية.
- `insertRight` (boolean, اختياري): إذا `true`، يُدرج إلى اليمين. إذا `false`، يُدرج إلى اليسار. الافتراضي هو `true`.
</Accordion>
<Accordion title="google_docs/delete_table_row">
**الوصف:** حذف صف من جدول موجود في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `tableStartIndex` (integer, مطلوب): فهرس بداية الجدول.
- `rowIndex` (integer, مطلوب): فهرس الصف (قائم على الصفر) المراد حذفه.
- `columnIndex` (integer, اختياري): فهرس العمود (قائم على الصفر) لأي خلية في الصف. الافتراضي هو `0`.
</Accordion>
<Accordion title="google_docs/delete_table_column">
**الوصف:** حذف عمود من جدول موجود في مستند Google.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `tableStartIndex` (integer, مطلوب): فهرس بداية الجدول.
- `rowIndex` (integer, اختياري): فهرس الصف (قائم على الصفر) لأي خلية في العمود. الافتراضي هو `0`.
- `columnIndex` (integer, مطلوب): فهرس العمود (قائم على الصفر) المراد حذفه.
</Accordion>
<Accordion title="google_docs/merge_table_cells">
**الوصف:** دمج نطاق من خلايا الجدول في خلية واحدة. يتم الاحتفاظ بمحتوى جميع الخلايا.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `tableStartIndex` (integer, مطلوب): فهرس بداية الجدول.
- `rowIndex` (integer, مطلوب): فهرس الصف البادئ (قائم على الصفر) للدمج.
- `columnIndex` (integer, مطلوب): فهرس العمود البادئ (قائم على الصفر) للدمج.
- `rowSpan` (integer, مطلوب): عدد الصفوف المراد دمجها.
- `columnSpan` (integer, مطلوب): عدد الأعمدة المراد دمجها.
</Accordion>
<Accordion title="google_docs/unmerge_table_cells">
**الوصف:** إلغاء دمج خلايا جدول مدمجة سابقاً وإعادتها إلى خلايا فردية.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `tableStartIndex` (integer, مطلوب): فهرس بداية الجدول.
- `rowIndex` (integer, مطلوب): فهرس الصف (قائم على الصفر) للخلية المدمجة.
- `columnIndex` (integer, مطلوب): فهرس العمود (قائم على الصفر) للخلية المدمجة.
- `rowSpan` (integer, مطلوب): عدد الصفوف التي تمتد عليها الخلية المدمجة.
- `columnSpan` (integer, مطلوب): عدد الأعمدة التي تمتد عليها الخلية المدمجة.
</Accordion>
<Accordion title="google_docs/insert_inline_image">
**الوصف:** إدراج صورة من عنوان URL عام في مستند Google. يجب أن تكون الصورة متاحة للعموم، وأقل من 50 ميجابايت، وبصيغة PNG/JPEG/GIF.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `uri` (string, مطلوب): عنوان URL العام للصورة. يجب أن يكون متاحاً بدون مصادقة.
- `index` (integer, اختياري): الموضع لإدراج الصورة. إذا لم يُحدد، تُدرج الصورة في نهاية المستند. الافتراضي هو `1`.
</Accordion>
<Accordion title="google_docs/insert_section_break">
**الوصف:** إدراج فاصل قسم لإنشاء أقسام مستند بتنسيقات مختلفة.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `index` (integer, مطلوب): الموضع لإدراج فاصل القسم.
- `sectionType` (string, مطلوب): نوع فاصل القسم. القيم: `CONTINUOUS` (يبقى في نفس الصفحة), `NEXT_PAGE` (يبدأ صفحة جديدة).
</Accordion>
<Accordion title="google_docs/create_header">
**الوصف:** إنشاء ترويسة للمستند. يُرجع headerId يمكن استخدامه مع insert_text لإضافة محتوى الترويسة.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `type` (string, اختياري): نوع الترويسة. القيم: `DEFAULT`. الافتراضي هو `DEFAULT`.
</Accordion>
<Accordion title="google_docs/create_footer">
**الوصف:** إنشاء تذييل للمستند. يُرجع footerId يمكن استخدامه مع insert_text لإضافة محتوى التذييل.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `type` (string, اختياري): نوع التذييل. القيم: `DEFAULT`. الافتراضي هو `DEFAULT`.
</Accordion>
<Accordion title="google_docs/delete_header">
**الوصف:** حذف ترويسة من المستند. استخدم get_document للعثور على headerId.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `headerId` (string, مطلوب): معرّف الترويسة المراد حذفها.
</Accordion>
<Accordion title="google_docs/delete_footer">
**الوصف:** حذف تذييل من المستند. استخدم get_document للعثور على footerId.
**المعاملات:**
- `documentId` (string, مطلوب): معرّف المستند.
- `footerId` (string, مطلوب): معرّف التذييل المراد حذفه.
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ Google Docs
```python
from crewai import Agent, Task, Crew
# Create an agent with Google Docs capabilities
docs_agent = Agent(
role="Document Creator",
goal="Create and manage Google Docs documents efficiently",
backstory="An AI assistant specialized in Google Docs document creation and editing.",
apps=['google_docs'] # All Google Docs actions will be available
)
# Task to create a new document
create_doc_task = Task(
description="Create a new Google Document titled 'Project Status Report'",
agent=docs_agent,
expected_output="New Google Document 'Project Status Report' created successfully"
)
# Run the task
crew = Crew(
agents=[docs_agent],
tasks=[create_doc_task]
)
crew.kickoff()
```
### تحرير النصوص وإدارة المحتوى
```python
from crewai import Agent, Task, Crew
# Create an agent focused on text editing
text_editor = Agent(
role="Document Editor",
goal="Edit and update content in Google Docs documents",
backstory="An AI assistant skilled in precise text editing and content management.",
apps=['google_docs/insert_text', 'google_docs/replace_text', 'google_docs/delete_content_range']
)
# Task to edit document content
edit_content_task = Task(
description="In document 'your_document_id', insert the text 'Executive Summary: ' at the beginning, then replace all instances of 'TODO' with 'COMPLETED'.",
agent=text_editor,
expected_output="Document updated with new text inserted and TODO items replaced."
)
crew = Crew(
agents=[text_editor],
tasks=[edit_content_task]
)
crew.kickoff()
```
### عمليات المستندات المتقدمة
```python
from crewai import Agent, Task, Crew
# Create an agent for advanced document operations
document_formatter = Agent(
role="Document Formatter",
goal="Apply advanced formatting and structure to Google Docs",
backstory="An AI assistant that handles complex document formatting and organization.",
apps=['google_docs/batch_update', 'google_docs/insert_page_break', 'google_docs/create_named_range']
)
# Task to format document
format_doc_task = Task(
description="In document 'your_document_id', insert a page break at position 100, create a named range called 'Introduction' for characters 1-50, and apply batch formatting updates.",
agent=document_formatter,
expected_output="Document formatted with page break, named range, and styling applied."
)
crew = Crew(
agents=[document_formatter],
tasks=[format_doc_task]
)
crew.kickoff()
```
## استكشاف الأخطاء وإصلاحها
### المشاكل الشائعة
**أخطاء المصادقة**
- تأكد من أن حساب Google الخاص بك لديه الصلاحيات اللازمة للوصول إلى Google Docs.
- تحقق من أن اتصال OAuth يتضمن جميع النطاقات المطلوبة (`https://www.googleapis.com/auth/documents`).
**مشاكل معرّف المستند**
- تحقق جيداً من صحة معرّفات المستندات.
- تأكد من وجود المستند وإمكانية الوصول إليه من حسابك.
- يمكن العثور على معرّفات المستندات في عنوان URL لـ Google Docs.
**عمليات إدراج النص والنطاقات**
- عند استخدام `insert_text` أو `delete_content_range`، تأكد من صحة مواضع الفهرس.
- تذكر أن Google Docs يستخدم فهرسة قائمة على الصفر.
- يجب أن يحتوي المستند على محتوى في مواضع الفهرس المحددة.
**تنسيق طلبات التحديث الدفعي**
- عند استخدام `batch_update`، تأكد من صحة تنسيق مصفوفة `requests` وفقاً لتوثيق Google Docs API.
- تتطلب التحديثات المعقدة هياكل JSON محددة لكل نوع طلب.
**عمليات استبدال النص**
- لـ `replace_text`، تأكد من مطابقة معامل `containsText` تماماً للنص المراد استبداله.
- استخدم معامل `matchCase` للتحكم في حساسية حالة الأحرف.
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل Google Docs أو
استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,238 @@
---
title: تكامل Google Drive
description: "تخزين الملفات وإدارتها مع تكامل Google Drive لـ CrewAI."
icon: "google"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إدارة الملفات والمجلدات عبر Google Drive. ارفع الملفات وحمّلها ونظّمها وشاركها، وأنشئ المجلدات، وبسّط سير عمل إدارة المستندات باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Google Drive، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Google مع إمكانية الوصول إلى Google Drive
- ربط حساب Google الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Google Drive
### 1. ربط حساب Google الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Google Drive** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة لإدارة الملفات والمجلدات
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="google_drive/get_file">
**الوصف:** الحصول على ملف بواسطة المعرّف من Google Drive.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف الملف المراد استرجاعه.
</Accordion>
<Accordion title="google_drive/list_files">
**الوصف:** عرض قائمة الملفات في Google Drive.
**المعاملات:**
- `q` (string, اختياري): سلسلة استعلام لتصفية الملفات (مثال: "name contains 'report'").
- `page_size` (integer, اختياري): الحد الأقصى لعدد الملفات المُرجعة (الافتراضي: 100، الحد الأقصى: 1000).
- `page_token` (string, اختياري): رمز لاسترجاع الصفحة التالية من النتائج.
- `order_by` (string, اختياري): ترتيب الفرز (مثال: "name", "createdTime desc", "modifiedTime").
- `spaces` (string, اختياري): قائمة مفصولة بفواصل للمساحات المراد الاستعلام عنها (drive, appDataFolder, photos).
</Accordion>
<Accordion title="google_drive/upload_file">
**الوصف:** رفع ملف إلى Google Drive.
**المعاملات:**
- `name` (string, مطلوب): اسم الملف المراد إنشاؤه.
- `content` (string, مطلوب): محتوى الملف المراد رفعه.
- `mime_type` (string, اختياري): نوع MIME للملف (مثال: "text/plain", "application/pdf").
- `parent_folder_id` (string, اختياري): معرّف المجلد الأصلي حيث يجب إنشاء الملف.
- `description` (string, اختياري): وصف الملف.
</Accordion>
<Accordion title="google_drive/download_file">
**الوصف:** تحميل ملف من Google Drive.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف الملف المراد تحميله.
- `mime_type` (string, اختياري): نوع MIME للتصدير (مطلوب لمستندات Google Workspace).
</Accordion>
<Accordion title="google_drive/create_folder">
**الوصف:** إنشاء مجلد جديد في Google Drive.
**المعاملات:**
- `name` (string, مطلوب): اسم المجلد المراد إنشاؤه.
- `parent_folder_id` (string, اختياري): معرّف المجلد الأصلي حيث يجب إنشاء المجلد الجديد.
- `description` (string, اختياري): وصف المجلد.
</Accordion>
<Accordion title="google_drive/delete_file">
**الوصف:** حذف ملف من Google Drive.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف الملف المراد حذفه.
</Accordion>
<Accordion title="google_drive/share_file">
**الوصف:** مشاركة ملف في Google Drive مع مستخدمين محددين أو جعله عاماً.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف الملف المراد مشاركته.
- `role` (string, مطلوب): الدور الممنوح بهذا الإذن (reader, writer, commenter, owner).
- `type` (string, مطلوب): نوع المستفيد (user, group, domain, anyone).
- `email_address` (string, اختياري): عنوان البريد الإلكتروني للمستخدم أو المجموعة المراد المشاركة معهم (مطلوب لأنواع user/group).
- `domain` (string, اختياري): النطاق المراد المشاركة معه (مطلوب لنوع domain).
- `send_notification_email` (boolean, اختياري): ما إذا كان يجب إرسال بريد إلكتروني إشعاري (الافتراضي: true).
- `email_message` (string, اختياري): رسالة نصية مخصصة لتضمينها في البريد الإلكتروني الإشعاري.
</Accordion>
<Accordion title="google_drive/update_file">
**الوصف:** تحديث ملف موجود في Google Drive.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف الملف المراد تحديثه.
- `name` (string, اختياري): الاسم الجديد للملف.
- `content` (string, اختياري): المحتوى الجديد للملف.
- `mime_type` (string, اختياري): نوع MIME الجديد للملف.
- `description` (string, اختياري): الوصف الجديد للملف.
- `add_parents` (string, اختياري): قائمة مفصولة بفواصل لمعرّفات المجلدات الأصلية المراد إضافتها.
- `remove_parents` (string, اختياري): قائمة مفصولة بفواصل لمعرّفات المجلدات الأصلية المراد إزالتها.
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ Google Drive
```python
from crewai import Agent, Task, Crew
# Create an agent with Google Drive capabilities
drive_agent = Agent(
role="File Manager",
goal="Manage files and folders in Google Drive efficiently",
backstory="An AI assistant specialized in document and file management.",
apps=['google_drive'] # All Google Drive actions will be available
)
# Task to organize files
organize_files_task = Task(
description="List all files in the root directory and organize them into appropriate folders",
agent=drive_agent,
expected_output="Summary of files organized with folder structure"
)
# Run the task
crew = Crew(
agents=[drive_agent],
tasks=[organize_files_task]
)
crew.kickoff()
```
### تصفية أدوات Google Drive المحددة
```python
from crewai import Agent, Task, Crew
# Create agent with specific Google Drive actions only
file_manager_agent = Agent(
role="Document Manager",
goal="Upload and manage documents efficiently",
backstory="An AI assistant that focuses on document upload and organization.",
apps=[
'google_drive/upload_file',
'google_drive/create_folder',
'google_drive/share_file'
] # Specific Google Drive actions
)
# Task to upload and share documents
document_task = Task(
description="Upload the quarterly report and share it with the finance team",
agent=file_manager_agent,
expected_output="Document uploaded and sharing permissions configured"
)
crew = Crew(
agents=[file_manager_agent],
tasks=[document_task]
)
crew.kickoff()
```
### إدارة الملفات المتقدمة
```python
from crewai import Agent, Task, Crew
file_organizer = Agent(
role="File Organizer",
goal="Maintain organized file structure and manage permissions",
backstory="An experienced file manager who ensures proper organization and access control.",
apps=['google_drive']
)
# Complex task involving multiple Google Drive operations
organization_task = Task(
description="""
1. List all files in the shared folder
2. Create folders for different document types (Reports, Presentations, Spreadsheets)
3. Move files to appropriate folders based on their type
4. Set appropriate sharing permissions for each folder
5. Create a summary document of the organization changes
""",
agent=file_organizer,
expected_output="Files organized into categorized folders with proper permissions and summary report"
)
crew = Crew(
agents=[file_organizer],
tasks=[organization_task]
)
crew.kickoff()
```

View File

@@ -0,0 +1,254 @@
---
title: تكامل Google Sheets
description: "مزامنة بيانات جداول البيانات مع تكامل Google Sheets لـ CrewAI."
icon: "google"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إدارة بيانات جداول البيانات عبر Google Sheets. اقرأ الصفوف، وأنشئ إدخالات جديدة، وحدّث البيانات الموجودة، وبسّط سير عمل إدارة البيانات باستخدام الأتمتة المدعومة بالذكاء الاصطناعي. مثالي لتتبع البيانات وإعداد التقارير وإدارة البيانات التعاونية.
## المتطلبات الأساسية
قبل استخدام تكامل Google Sheets، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Google مع إمكانية الوصول إلى Google Sheets
- ربط حساب Google الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
- جداول بيانات بترويسات أعمدة مناسبة لعمليات البيانات
## إعداد تكامل Google Sheets
### 1. ربط حساب Google الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Google Sheets** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة للوصول إلى جداول البيانات
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="google_sheets/get_spreadsheet">
**الوصف:** استرجاع خصائص وبيانات جدول البيانات.
**المعاملات:**
- `spreadsheetId` (string, مطلوب): معرّف جدول البيانات المراد استرجاعه.
- `ranges` (array, اختياري): النطاقات المراد استرجاعها من جدول البيانات.
- `includeGridData` (boolean, اختياري): true إذا كان يجب إرجاع بيانات الشبكة. الافتراضي: false
- `fields` (string, اختياري): الحقول المراد تضمينها في الاستجابة.
</Accordion>
<Accordion title="google_sheets/get_values">
**الوصف:** إرجاع نطاق من القيم من جدول البيانات.
**المعاملات:**
- `spreadsheetId` (string, مطلوب): معرّف جدول البيانات المراد استرجاع البيانات منه.
- `range` (string, مطلوب): ترميز A1 أو R1C1 للنطاق المراد استرجاع القيم منه.
- `valueRenderOption` (string, اختياري): كيفية تمثيل القيم في الإخراج. الخيارات: FORMATTED_VALUE, UNFORMATTED_VALUE, FORMULA. الافتراضي: FORMATTED_VALUE
- `dateTimeRenderOption` (string, اختياري): كيفية تمثيل التواريخ والأوقات في الإخراج. الخيارات: SERIAL_NUMBER, FORMATTED_STRING. الافتراضي: SERIAL_NUMBER
- `majorDimension` (string, اختياري): البُعد الرئيسي للنتائج. الخيارات: ROWS, COLUMNS. الافتراضي: ROWS
</Accordion>
<Accordion title="google_sheets/update_values">
**الوصف:** تعيين القيم في نطاق من جدول البيانات.
**المعاملات:**
- `spreadsheetId` (string, مطلوب): معرّف جدول البيانات المراد تحديثه.
- `range` (string, مطلوب): ترميز A1 للنطاق المراد تحديثه.
- `values` (array, مطلوب): البيانات المراد كتابتها. كل مصفوفة تمثل صفاً.
```json
[
["Value1", "Value2", "Value3"],
["Value4", "Value5", "Value6"]
]
```
- `valueInputOption` (string, اختياري): كيفية تفسير بيانات الإدخال. الخيارات: RAW, USER_ENTERED. الافتراضي: USER_ENTERED
</Accordion>
<Accordion title="google_sheets/append_values">
**الوصف:** إلحاق قيم بجدول البيانات.
**المعاملات:**
- `spreadsheetId` (string, مطلوب): معرّف جدول البيانات المراد تحديثه.
- `range` (string, مطلوب): ترميز A1 لنطاق البحث عن جدول بيانات منطقي.
- `values` (array, مطلوب): البيانات المراد إلحاقها. كل مصفوفة تمثل صفاً.
```json
[
["Value1", "Value2", "Value3"],
["Value4", "Value5", "Value6"]
]
```
- `valueInputOption` (string, اختياري): كيفية تفسير بيانات الإدخال. الخيارات: RAW, USER_ENTERED. الافتراضي: USER_ENTERED
- `insertDataOption` (string, اختياري): كيفية إدراج بيانات الإدخال. الخيارات: OVERWRITE, INSERT_ROWS. الافتراضي: INSERT_ROWS
</Accordion>
<Accordion title="google_sheets/create_spreadsheet">
**الوصف:** إنشاء جدول بيانات جديد.
**المعاملات:**
- `title` (string, مطلوب): عنوان جدول البيانات الجديد.
- `sheets` (array, اختياري): الأوراق التي تشكل جزءاً من جدول البيانات.
```json
[
{
"properties": {
"title": "Sheet1"
}
}
]
```
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ Google Sheets
```python
from crewai import Agent, Task, Crew
# Create an agent with Google Sheets capabilities
sheets_agent = Agent(
role="Data Manager",
goal="Manage spreadsheet data and track information efficiently",
backstory="An AI assistant specialized in data management and spreadsheet operations.",
apps=['google_sheets']
)
# Task to add new data to a spreadsheet
data_entry_task = Task(
description="Add a new customer record to the customer database spreadsheet with name, email, and signup date",
agent=sheets_agent,
expected_output="New customer record added successfully to the spreadsheet"
)
# Run the task
crew = Crew(
agents=[sheets_agent],
tasks=[data_entry_task]
)
crew.kickoff()
```
### تصفية أدوات Google Sheets المحددة
```python
from crewai import Agent, Task, Crew
# Create agent with specific Google Sheets actions only
data_collector = Agent(
role="Data Collector",
goal="Collect and organize data in spreadsheets",
backstory="An AI assistant that focuses on data collection and organization.",
apps=[
'google_sheets/get_values',
'google_sheets/update_values'
]
)
# Task to collect and organize data
data_collection = Task(
description="Retrieve current inventory data and add new product entries to the inventory spreadsheet",
agent=data_collector,
expected_output="Inventory data retrieved and new products added successfully"
)
crew = Crew(
agents=[data_collector],
tasks=[data_collection]
)
crew.kickoff()
```
### تحليل البيانات وإعداد التقارير
```python
from crewai import Agent, Task, Crew
data_analyst = Agent(
role="Data Analyst",
goal="Analyze spreadsheet data and generate insights",
backstory="An experienced data analyst who extracts insights from spreadsheet data.",
apps=['google_sheets']
)
# Task to analyze data and create reports
analysis_task = Task(
description="""
1. Retrieve all sales data from the current month's spreadsheet
2. Analyze the data for trends and patterns
3. Create a summary report in a new row with key metrics
""",
agent=data_analyst,
expected_output="Sales data analyzed and summary report created with key insights"
)
crew = Crew(
agents=[data_analyst],
tasks=[analysis_task]
)
crew.kickoff()
```
## استكشاف الأخطاء وإصلاحها
### المشاكل الشائعة
**أخطاء الصلاحيات**
- تأكد من أن حساب Google الخاص بك لديه صلاحية التحرير على جداول البيانات المستهدفة
- تحقق من أن اتصال OAuth يتضمن النطاقات المطلوبة لـ Google Sheets API
- تأكد من مشاركة جداول البيانات مع الحساب المصادق عليه
**مشاكل هيكل جدول البيانات**
- تأكد من أن أوراق العمل تحتوي على ترويسات أعمدة مناسبة قبل إنشاء الصفوف أو تحديثها
- تحقق من صحة ترميز النطاق (صيغة A1) للخلايا المستهدفة
- تأكد من وجود معرّف جدول البيانات المحدد وإمكانية الوصول إليه
**مشاكل نوع البيانات والصيغة**
- تأكد من تطابق قيم البيانات مع الصيغة المتوقعة لكل عمود
- استخدم صيغ التاريخ المناسبة لأعمدة التاريخ (يُنصح بصيغة ISO)
- تحقق من صحة تنسيق القيم الرقمية لأعمدة الأرقام
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل Google Sheets
أو استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,382 @@
---
title: تكامل Google Slides
description: "إنشاء العروض التقديمية وإدارتها مع تكامل Google Slides لـ CrewAI."
icon: "chart-bar"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إنشاء وتحرير وإدارة عروض Google Slides التقديمية. أنشئ العروض التقديمية، وحدّث المحتوى، واستورد البيانات من Google Sheets، وأدر الصفحات والصور المصغرة، وبسّط سير عمل العروض التقديمية باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Google Slides، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Google مع إمكانية الوصول إلى Google Slides
- ربط حساب Google الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Google Slides
### 1. ربط حساب Google الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Google Slides** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة للوصول إلى العروض التقديمية وجداول البيانات وDrive
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="google_slides/create_blank_presentation">
**الوصف:** إنشاء عرض تقديمي فارغ بدون محتوى.
**المعاملات:**
- `title` (string, مطلوب): عنوان العرض التقديمي.
</Accordion>
<Accordion title="google_slides/get_presentation_metadata">
**الوصف:** الحصول على بيانات وصفية خفيفة حول العرض التقديمي (العنوان، عدد الشرائح، معرّفات الشرائح).
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي المراد استرجاعه.
</Accordion>
<Accordion title="google_slides/get_presentation_text">
**الوصف:** استخراج جميع المحتوى النصي من العرض التقديمي.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
</Accordion>
<Accordion title="google_slides/get_presentation">
**الوصف:** استرجاع عرض تقديمي بواسطة المعرّف.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي المراد استرجاعه.
- `fields` (string, اختياري): الحقول المراد تضمينها في الاستجابة.
</Accordion>
<Accordion title="google_slides/batch_update_presentation">
**الوصف:** تطبيق التحديثات أو إضافة المحتوى أو إزالته من العرض التقديمي.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي المراد تحديثه.
- `requests` (array, مطلوب): قائمة بالتحديثات المراد تطبيقها.
```json
[
{
"insertText": {
"objectId": "slide_id",
"text": "Your text content here"
}
}
]
```
- `writeControl` (object, اختياري): يوفر التحكم في كيفية تنفيذ طلبات الكتابة.
</Accordion>
<Accordion title="google_slides/get_slide_text">
**الوصف:** استخراج المحتوى النصي من شريحة واحدة.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `pageObjectId` (string, مطلوب): معرّف الشريحة/الصفحة.
</Accordion>
<Accordion title="google_slides/get_page">
**الوصف:** استرجاع صفحة محددة بواسطة معرّفها.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `pageObjectId` (string, مطلوب): معرّف الصفحة المراد استرجاعها.
</Accordion>
<Accordion title="google_slides/get_thumbnail">
**الوصف:** إنشاء صورة مصغرة للصفحة.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `pageObjectId` (string, مطلوب): معرّف الصفحة لإنشاء الصورة المصغرة.
</Accordion>
<Accordion title="google_slides/create_slide">
**الوصف:** إضافة شريحة فارغة إضافية للعرض التقديمي.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `insertionIndex` (integer, اختياري): مكان إدراج الشريحة (قائم على الصفر). إذا حُذف، تُضاف في النهاية.
</Accordion>
<Accordion title="google_slides/create_slide_with_layout">
**الوصف:** إنشاء شريحة بتخطيط محدد مسبقاً يحتوي على مناطق عناصر نائبة للعنوان والمحتوى وغيرها.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `layout` (string, مطلوب): نوع التخطيط. أحد: `BLANK`, `TITLE`, `TITLE_AND_BODY`, `TITLE_AND_TWO_COLUMNS`, `TITLE_ONLY`, `SECTION_HEADER`, `ONE_COLUMN_TEXT`, `MAIN_POINT`, `BIG_NUMBER`.
- `insertionIndex` (integer, اختياري): مكان الإدراج (قائم على الصفر). حُذف للإضافة في النهاية.
</Accordion>
<Accordion title="google_slides/create_text_box">
**الوصف:** إنشاء مربع نص على شريحة مع محتوى.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `slideId` (string, مطلوب): معرّف الشريحة لإضافة مربع النص إليها.
- `text` (string, مطلوب): المحتوى النصي لمربع النص.
- `x` (integer, اختياري): موضع X بوحدة EMU (914400 = 1 بوصة). الافتراضي: 914400.
- `y` (integer, اختياري): موضع Y بوحدة EMU. الافتراضي: 914400.
- `width` (integer, اختياري): العرض بوحدة EMU. الافتراضي: 7315200.
- `height` (integer, اختياري): الارتفاع بوحدة EMU. الافتراضي: 914400.
</Accordion>
<Accordion title="google_slides/delete_slide">
**الوصف:** إزالة شريحة من العرض التقديمي.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `slideId` (string, مطلوب): معرّف الشريحة المراد حذفها.
</Accordion>
<Accordion title="google_slides/duplicate_slide">
**الوصف:** إنشاء نسخة من شريحة موجودة.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `slideId` (string, مطلوب): معرّف الشريحة المراد تكرارها.
</Accordion>
<Accordion title="google_slides/move_slides">
**الوصف:** إعادة ترتيب الشرائح بنقلها إلى موضع جديد.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `slideIds` (array of strings, مطلوب): مصفوفة من معرّفات الشرائح المراد نقلها.
- `insertionIndex` (integer, مطلوب): الموضع المستهدف (قائم على الصفر).
</Accordion>
<Accordion title="google_slides/insert_youtube_video">
**الوصف:** تضمين فيديو YouTube على شريحة.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `slideId` (string, مطلوب): معرّف الشريحة لإضافة الفيديو إليها.
- `videoId` (string, مطلوب): معرّف فيديو YouTube (القيمة بعد v= في عنوان URL).
</Accordion>
<Accordion title="google_slides/insert_drive_video">
**الوصف:** تضمين فيديو من Google Drive على شريحة.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `slideId` (string, مطلوب): معرّف الشريحة لإضافة الفيديو إليها.
- `fileId` (string, مطلوب): معرّف ملف Google Drive للفيديو.
</Accordion>
<Accordion title="google_slides/set_slide_background_image">
**الوصف:** تعيين صورة خلفية لشريحة.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `slideId` (string, مطلوب): معرّف الشريحة لتعيين الخلفية لها.
- `imageUrl` (string, مطلوب): عنوان URL المتاح للعموم للصورة المراد استخدامها كخلفية.
</Accordion>
<Accordion title="google_slides/create_table">
**الوصف:** إنشاء جدول فارغ على شريحة.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `slideId` (string, مطلوب): معرّف الشريحة لإضافة الجدول إليها.
- `rows` (integer, مطلوب): عدد الصفوف في الجدول.
- `columns` (integer, مطلوب): عدد الأعمدة في الجدول.
</Accordion>
<Accordion title="google_slides/create_table_with_content">
**الوصف:** إنشاء جدول مع محتوى في إجراء واحد.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `slideId` (string, مطلوب): معرّف الشريحة لإضافة الجدول إليها.
- `rows` (integer, مطلوب): عدد الصفوف في الجدول.
- `columns` (integer, مطلوب): عدد الأعمدة في الجدول.
- `content` (array, مطلوب): محتوى الجدول كمصفوفة ثنائية الأبعاد. مثال: [["Year", "Revenue"], ["2023", "$10M"]].
</Accordion>
<Accordion title="google_slides/import_data_from_sheet">
**الوصف:** استيراد البيانات من Google Sheet إلى العرض التقديمي.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `sheetId` (string, مطلوب): معرّف Google Sheet المراد الاستيراد منه.
- `dataRange` (string, مطلوب): نطاق البيانات المراد استيرادها من الورقة.
</Accordion>
<Accordion title="google_slides/upload_file_to_drive">
**الوصف:** رفع ملف إلى Google Drive المرتبط بالعرض التقديمي.
**المعاملات:**
- `file` (string, مطلوب): بيانات الملف المراد رفعها.
- `presentationId` (string, مطلوب): معرّف العرض التقديمي لربط الملف المرفوع.
</Accordion>
<Accordion title="google_slides/link_file_to_presentation">
**الوصف:** ربط ملف في Google Drive بالعرض التقديمي.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي.
- `fileId` (string, مطلوب): معرّف الملف المراد ربطه.
</Accordion>
<Accordion title="google_slides/get_all_presentations">
**الوصف:** عرض قائمة بجميع العروض التقديمية المتاحة للمستخدم.
**المعاملات:**
- `pageSize` (integer, اختياري): عدد العروض التقديمية المراد إرجاعها لكل صفحة.
- `pageToken` (string, اختياري): رمز للترقيم.
</Accordion>
<Accordion title="google_slides/delete_presentation">
**الوصف:** حذف عرض تقديمي بواسطة المعرّف.
**المعاملات:**
- `presentationId` (string, مطلوب): معرّف العرض التقديمي المراد حذفه.
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ Google Slides
```python
from crewai import Agent, Task, Crew
# Create an agent with Google Slides capabilities
slides_agent = Agent(
role="Presentation Manager",
goal="Create and manage presentations efficiently",
backstory="An AI assistant specialized in presentation creation and content management.",
apps=['google_slides'] # All Google Slides actions will be available
)
# Task to create a presentation
create_presentation_task = Task(
description="Create a new presentation for the quarterly business review with key slides",
agent=slides_agent,
expected_output="Quarterly business review presentation created with structured content"
)
# Run the task
crew = Crew(
agents=[slides_agent],
tasks=[create_presentation_task]
)
crew.kickoff()
```
### إدارة محتوى العروض التقديمية
```python
from crewai import Agent, Task, Crew
content_manager = Agent(
role="Content Manager",
goal="Manage presentation content and updates",
backstory="An AI assistant that focuses on content creation and presentation updates.",
apps=[
'google_slides/create_blank_presentation',
'google_slides/batch_update_presentation',
'google_slides/get_presentation'
]
)
# Task to create and update presentations
content_task = Task(
description="Create a new presentation and add content slides with charts and text",
agent=content_manager,
expected_output="Presentation created with updated content and visual elements"
)
crew = Crew(
agents=[content_manager],
tasks=[content_task]
)
crew.kickoff()
```
## استكشاف الأخطاء وإصلاحها
### المشاكل الشائعة
**أخطاء الصلاحيات**
- تأكد من أن حساب Google الخاص بك لديه الصلاحيات المناسبة لـ Google Slides
- تحقق من أن اتصال OAuth يتضمن النطاقات المطلوبة للعروض التقديمية وجداول البيانات وDrive
**مشاكل معرّف العرض التقديمي**
- تحقق من صحة معرّفات العروض التقديمية ووجودها
- تأكد من أن لديك صلاحيات الوصول للعروض التقديمية التي تحاول تعديلها
**مشاكل تحديث المحتوى**
- تأكد من صحة تنسيق طلبات التحديث الدفعي وفقاً لمواصفات Google Slides API
- تحقق من وجود معرّفات الكائنات للشرائح والعناصر في العرض التقديمي
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل Google Slides
أو استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,360 @@
---
title: تكامل HubSpot
description: "إدارة الشركات وجهات الاتصال في HubSpot مع CrewAI."
icon: "briefcase"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إدارة الشركات وجهات الاتصال داخل HubSpot. أنشئ سجلات جديدة وبسّط عمليات CRM باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل HubSpot، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال.
- حساب HubSpot بالصلاحيات المناسبة.
- ربط حساب HubSpot الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors).
## إعداد تكامل HubSpot
### 1. ربط حساب HubSpot الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors).
2. ابحث عن **HubSpot** في قسم تكاملات المصادقة.
3. انقر على **Connect** وأكمل عملية OAuth.
4. امنح الصلاحيات اللازمة لإدارة الشركات وجهات الاتصال.
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="hubspot/create_company">
**الوصف:** إنشاء سجل شركة جديد في HubSpot.
**المعاملات:**
- `name` (string, مطلوب): اسم الشركة.
- `domain` (string, اختياري): اسم نطاق الشركة.
- `industry` (string, اختياري): القطاع.
- `phone` (string, اختياري): رقم الهاتف.
- `hubspot_owner_id` (string, اختياري): معرّف مالك الشركة.
- `type` (string, اختياري): نوع الشركة. القيم المتاحة: `PROSPECT`, `PARTNER`, `RESELLER`, `VENDOR`, `OTHER`.
- `city` (string, اختياري): المدينة.
- `state` (string, اختياري): الولاية/المنطقة.
- `zip` (string, اختياري): الرمز البريدي.
- `numberofemployees` (number, اختياري): عدد الموظفين.
- `annualrevenue` (number, اختياري): الإيرادات السنوية.
- `description` (string, اختياري): الوصف.
- `website` (string, اختياري): عنوان URL للموقع الإلكتروني.
</Accordion>
<Accordion title="hubspot/create_contact">
**الوصف:** إنشاء سجل جهة اتصال جديد في HubSpot.
**المعاملات:**
- `email` (string, مطلوب): عنوان البريد الإلكتروني لجهة الاتصال.
- `firstname` (string, اختياري): الاسم الأول.
- `lastname` (string, اختياري): اسم العائلة.
- `phone` (string, اختياري): رقم الهاتف.
- `hubspot_owner_id` (string, اختياري): مالك جهة الاتصال.
- `lifecyclestage` (string, اختياري): مرحلة دورة الحياة. القيم المتاحة: `subscriber`, `lead`, `marketingqualifiedlead`, `salesqualifiedlead`, `opportunity`, `customer`, `evangelist`, `other`.
- `company` (string, اختياري): اسم الشركة.
- `jobtitle` (string, اختياري): المسمى الوظيفي.
</Accordion>
<Accordion title="hubspot/create_deal">
**الوصف:** إنشاء سجل صفقة جديد في HubSpot.
**المعاملات:**
- `dealname` (string, مطلوب): اسم الصفقة.
- `amount` (number, اختياري): قيمة الصفقة.
- `dealstage` (string, اختياري): مرحلة مسار الصفقة.
- `pipeline` (string, اختياري): مسار المبيعات الذي تنتمي إليه الصفقة.
- `closedate` (string, اختياري): التاريخ المتوقع لإغلاق الصفقة.
- `hubspot_owner_id` (string, اختياري): مالك الصفقة.
- `dealtype` (string, اختياري): نوع الصفقة. القيم المتاحة: `newbusiness`, `existingbusiness`.
- `description` (string, اختياري): وصف الصفقة.
- `hs_priority` (string, اختياري): أولوية الصفقة. القيم المتاحة: `low`, `medium`, `high`.
</Accordion>
<Accordion title="hubspot/create_record_engagements">
**الوصف:** إنشاء تفاعل جديد (مثل ملاحظة، بريد إلكتروني، مكالمة، اجتماع، مهمة) في HubSpot.
**المعاملات:**
- `engagementType` (string, مطلوب): نوع التفاعل. القيم المتاحة: `NOTE`, `EMAIL`, `CALL`, `MEETING`, `TASK`.
- `hubspot_owner_id` (string, اختياري): المستخدم المعيّن للنشاط.
- `hs_timestamp` (string, اختياري): تاريخ ووقت النشاط.
- `hs_note_body` (string, اختياري): نص الملاحظة. (يُستخدم لـ `NOTE`)
- `hs_task_subject` (string, اختياري): عنوان المهمة. (يُستخدم لـ `TASK`)
- `hs_meeting_title` (string, اختياري): عنوان الاجتماع. (يُستخدم لـ `MEETING`)
</Accordion>
<Accordion title="hubspot/update_company">
**الوصف:** تحديث سجل شركة موجود في HubSpot.
**المعاملات:**
- `recordId` (string, مطلوب): معرّف الشركة المراد تحديثها.
- `name` (string, اختياري): اسم الشركة.
- `domain` (string, اختياري): اسم نطاق الشركة.
- `industry` (string, اختياري): القطاع.
- `phone` (string, اختياري): رقم الهاتف.
- `description` (string, اختياري): الوصف.
</Accordion>
<Accordion title="hubspot/update_contact">
**الوصف:** تحديث سجل جهة اتصال موجود في HubSpot.
**المعاملات:**
- `recordId` (string, مطلوب): معرّف جهة الاتصال المراد تحديثها.
- `firstname` (string, اختياري): الاسم الأول.
- `lastname` (string, اختياري): اسم العائلة.
- `email` (string, اختياري): عنوان البريد الإلكتروني.
- `phone` (string, اختياري): رقم الهاتف.
- `company` (string, اختياري): اسم الشركة.
- `jobtitle` (string, اختياري): المسمى الوظيفي.
</Accordion>
<Accordion title="hubspot/update_deal">
**الوصف:** تحديث سجل صفقة موجود في HubSpot.
**المعاملات:**
- `recordId` (string, مطلوب): معرّف الصفقة المراد تحديثها.
- `dealname` (string, اختياري): اسم الصفقة.
- `amount` (number, اختياري): قيمة الصفقة.
- `dealstage` (string, اختياري): مرحلة مسار الصفقة.
- `closedate` (string, اختياري): تاريخ الإغلاق المتوقع.
</Accordion>
<Accordion title="hubspot/list_companies">
**الوصف:** الحصول على قائمة بسجلات الشركات من HubSpot.
**المعاملات:**
- `paginationParameters` (object, اختياري): استخدم `pageCursor` لجلب الصفحات اللاحقة.
</Accordion>
<Accordion title="hubspot/list_contacts">
**الوصف:** الحصول على قائمة بسجلات جهات الاتصال من HubSpot.
**المعاملات:**
- `paginationParameters` (object, اختياري): استخدم `pageCursor` لجلب الصفحات اللاحقة.
</Accordion>
<Accordion title="hubspot/list_deals">
**الوصف:** الحصول على قائمة بسجلات الصفقات من HubSpot.
**المعاملات:**
- `paginationParameters` (object, اختياري): استخدم `pageCursor` لجلب الصفحات اللاحقة.
</Accordion>
<Accordion title="hubspot/get_company">
**الوصف:** الحصول على سجل شركة واحد بواسطة معرّفه.
**المعاملات:**
- `recordId` (string, مطلوب): معرّف الشركة المراد استرجاعها.
</Accordion>
<Accordion title="hubspot/get_contact">
**الوصف:** الحصول على سجل جهة اتصال واحد بواسطة معرّفه.
**المعاملات:**
- `recordId` (string, مطلوب): معرّف جهة الاتصال المراد استرجاعها.
</Accordion>
<Accordion title="hubspot/get_deal">
**الوصف:** الحصول على سجل صفقة واحد بواسطة معرّفه.
**المعاملات:**
- `recordId` (string, مطلوب): معرّف الصفقة المراد استرجاعها.
</Accordion>
<Accordion title="hubspot/search_companies">
**الوصف:** البحث عن سجلات الشركات في HubSpot باستخدام صيغة فلتر.
**المعاملات:**
- `filterFormula` (object, اختياري): فلتر بصيغة التعبير العادي المنفصل (OR لمجموعات AND).
- `paginationParameters` (object, اختياري): استخدم `pageCursor` لجلب الصفحات اللاحقة.
</Accordion>
<Accordion title="hubspot/search_contacts">
**الوصف:** البحث عن سجلات جهات الاتصال في HubSpot باستخدام صيغة فلتر.
**المعاملات:**
- `filterFormula` (object, اختياري): فلتر بصيغة التعبير العادي المنفصل (OR لمجموعات AND).
- `paginationParameters` (object, اختياري): استخدم `pageCursor` لجلب الصفحات اللاحقة.
</Accordion>
<Accordion title="hubspot/search_deals">
**الوصف:** البحث عن سجلات الصفقات في HubSpot باستخدام صيغة فلتر.
**المعاملات:**
- `filterFormula` (object, اختياري): فلتر بصيغة التعبير العادي المنفصل (OR لمجموعات AND).
- `paginationParameters` (object, اختياري): استخدم `pageCursor` لجلب الصفحات اللاحقة.
</Accordion>
<Accordion title="hubspot/delete_record_companies">
**الوصف:** حذف سجل شركة بواسطة معرّفه.
**المعاملات:**
- `recordId` (string, مطلوب): معرّف الشركة المراد حذفها.
</Accordion>
<Accordion title="hubspot/delete_record_contacts">
**الوصف:** حذف سجل جهة اتصال بواسطة معرّفه.
**المعاملات:**
- `recordId` (string, مطلوب): معرّف جهة الاتصال المراد حذفها.
</Accordion>
<Accordion title="hubspot/delete_record_deals">
**الوصف:** حذف سجل صفقة بواسطة معرّفه.
**المعاملات:**
- `recordId` (string, مطلوب): معرّف الصفقة المراد حذفها.
</Accordion>
<Accordion title="hubspot/describe_action_schema">
**الوصف:** الحصول على المخطط المتوقع لنوع كائن وعملية معينة.
**المعاملات:**
- `recordType` (string, مطلوب): معرّف نوع الكائن (مثال: 'companies').
- `operation` (string, مطلوب): نوع العملية (مثال: 'CREATE_RECORD').
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ HubSpot
```python
from crewai import Agent, Task, Crew
# Create an agent with HubSpot capabilities
hubspot_agent = Agent(
role="CRM Manager",
goal="Manage company and contact records in HubSpot",
backstory="An AI assistant specialized in CRM management.",
apps=['hubspot'] # All HubSpot actions will be available
)
# Task to create a new company
create_company_task = Task(
description="Create a new company in HubSpot with name 'Innovate Corp' and domain 'innovatecorp.com'.",
agent=hubspot_agent,
expected_output="Company created successfully with confirmation"
)
# Run the task
crew = Crew(
agents=[hubspot_agent],
tasks=[create_company_task]
)
crew.kickoff()
```
### تصفية أدوات HubSpot المحددة
```python
from crewai import Agent, Task, Crew
# Create agent with specific HubSpot actions only
contact_creator = Agent(
role="Contact Creator",
goal="Create new contacts in HubSpot",
backstory="An AI assistant that focuses on creating new contact entries in the CRM.",
apps=['hubspot/create_contact'] # Only contact creation action
)
# Task to create a contact
create_contact = Task(
description="Create a new contact for 'John Doe' with email 'john.doe@example.com'.",
agent=contact_creator,
expected_output="Contact created successfully in HubSpot."
)
crew = Crew(
agents=[contact_creator],
tasks=[create_contact]
)
crew.kickoff()
```
### إدارة جهات الاتصال
```python
from crewai import Agent, Task, Crew
# Create agent with HubSpot contact management capabilities
crm_manager = Agent(
role="CRM Manager",
goal="Manage and organize HubSpot contacts efficiently.",
backstory="An experienced CRM manager who maintains an organized contact database.",
apps=['hubspot'] # All HubSpot actions including contact management
)
# Task to manage contacts
contact_task = Task(
description="Create a new contact for 'Jane Smith' at 'Global Tech Inc.' with email 'jane.smith@globaltech.com'.",
agent=crm_manager,
expected_output="Contact database updated with the new contact."
)
crew = Crew(
agents=[crm_manager],
tasks=[contact_task]
)
crew.kickoff()
```
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل HubSpot أو
استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,248 @@
---
title: تكامل Jira
description: "تتبع المشكلات وإدارة المشاريع مع تكامل Jira لـ CrewAI."
icon: "bug"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إدارة المشكلات والمشاريع وسير العمل عبر Jira. أنشئ المشكلات وحدّثها، وتتبع تقدم المشاريع، وأدر التعيينات، وبسّط إدارة مشاريعك باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Jira، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Jira بصلاحيات المشروع المناسبة
- ربط حساب Jira الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Jira
### 1. ربط حساب Jira الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Jira** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة لإدارة المشكلات والمشاريع
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="jira/create_issue">
**الوصف:** إنشاء مشكلة في Jira.
**المعاملات:**
- `summary` (string, مطلوب): الملخص - ملخص موجز من سطر واحد للمشكلة. (مثال: "The printer stopped working").
- `project` (string, اختياري): المشروع - المشروع الذي تنتمي إليه المشكلة.
- `issueType` (string, اختياري): نوع المشكلة - الافتراضي هو Task.
- `jiraIssueStatus` (string, اختياري): الحالة - الافتراضي هو أول حالة في المشروع.
- `assignee` (string, اختياري): المكلّف - الافتراضي هو المستخدم المصادق عليه.
- `description` (string, اختياري): الوصف - وصف تفصيلي للمشكلة.
- `additionalFields` (string, اختياري): حقول إضافية - حدد أي حقول أخرى بصيغة JSON.
</Accordion>
<Accordion title="jira/update_issue">
**الوصف:** تحديث مشكلة في Jira.
**المعاملات:**
- `issueKey` (string, مطلوب): مفتاح المشكلة (مثال: "TEST-1234").
- `summary` (string, اختياري): الملخص.
- `issueType` (string, اختياري): نوع المشكلة.
- `jiraIssueStatus` (string, اختياري): الحالة.
- `assignee` (string, اختياري): المكلّف.
- `description` (string, اختياري): الوصف.
- `additionalFields` (string, اختياري): حقول إضافية بصيغة JSON.
</Accordion>
<Accordion title="jira/get_issue_by_key">
**الوصف:** الحصول على مشكلة بواسطة المفتاح في Jira.
**المعاملات:**
- `issueKey` (string, مطلوب): مفتاح المشكلة (مثال: "TEST-1234").
</Accordion>
<Accordion title="jira/filter_issues">
**الوصف:** البحث عن المشكلات في Jira باستخدام الفلاتر.
**المعاملات:**
- `jqlQuery` (object, اختياري): فلتر بصيغة التعبير العادي المنفصل.
- `limit` (string, اختياري): حدود النتائج - الافتراضي 10.
</Accordion>
<Accordion title="jira/search_by_jql">
**الوصف:** البحث عن المشكلات بواسطة JQL في Jira.
**المعاملات:**
- `jqlQuery` (string, مطلوب): استعلام JQL (مثال: "project = PROJECT").
- `paginationParameters` (object, اختياري): معاملات الترقيم.
</Accordion>
<Accordion title="jira/describe_action_schema">
**الوصف:** الحصول على المخطط المتوقع لنوع مشكلة.
**المعاملات:**
- `issueTypeId` (string, مطلوب): معرّف نوع المشكلة.
- `projectKey` (string, مطلوب): مفتاح المشروع.
- `operation` (string, مطلوب): نوع العملية، مثال CREATE_ISSUE أو UPDATE_ISSUE.
</Accordion>
<Accordion title="jira/get_projects">
**الوصف:** الحصول على المشاريع في Jira.
**المعاملات:**
- `paginationParameters` (object, اختياري): معاملات الترقيم.
</Accordion>
<Accordion title="jira/get_issue_types_by_project">
**الوصف:** الحصول على أنواع المشكلات بواسطة المشروع في Jira.
**المعاملات:**
- `project` (string, مطلوب): مفتاح المشروع.
</Accordion>
<Accordion title="jira/get_issue_types">
**الوصف:** الحصول على جميع أنواع المشكلات في Jira.
**المعاملات:** لا توجد معاملات مطلوبة.
</Accordion>
<Accordion title="jira/get_issue_status_by_project">
**الوصف:** الحصول على حالات المشكلات لمشروع معين.
**المعاملات:**
- `project` (string, مطلوب): مفتاح المشروع.
</Accordion>
<Accordion title="jira/get_all_assignees_by_project">
**الوصف:** الحصول على المكلّفين لمشروع معين.
**المعاملات:**
- `project` (string, مطلوب): مفتاح المشروع.
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ Jira
```python
from crewai import Agent, Task, Crew
from crewai import Agent, Task, Crew
# Create an agent with Jira capabilities
jira_agent = Agent(
role="Issue Manager",
goal="Manage Jira issues and track project progress efficiently",
backstory="An AI assistant specialized in issue tracking and project management.",
apps=['jira'] # All Jira actions will be available
)
# Task to create a bug report
create_bug_task = Task(
description="Create a bug report for the login functionality with high priority and assign it to the development team",
agent=jira_agent,
expected_output="Bug report created successfully with issue key"
)
# Run the task
crew = Crew(
agents=[jira_agent],
tasks=[create_bug_task]
)
crew.kickoff()
```
### تحليل المشاريع وإعداد التقارير
```python
from crewai import Agent, Task, Crew
project_analyst = Agent(
role="Project Analyst",
goal="Analyze project data and generate insights from Jira",
backstory="An experienced project analyst who extracts insights from project management data.",
apps=['jira']
)
# Task to analyze project status
analysis_task = Task(
description="""
1. Get all projects and their issue types
2. Search for all open issues across projects
3. Analyze issue distribution by status and assignee
4. Create a summary report issue with findings
""",
agent=project_analyst,
expected_output="Project analysis completed with summary report created"
)
crew = Crew(
agents=[project_analyst],
tasks=[analysis_task]
)
crew.kickoff()
```
## استكشاف الأخطاء وإصلاحها
### المشاكل الشائعة
**أخطاء الصلاحيات**
- تأكد من أن حساب Jira الخاص بك لديه الصلاحيات اللازمة للمشاريع المستهدفة
- تحقق من أن اتصال OAuth يتضمن النطاقات المطلوبة لـ Jira API
**مفاتيح المشاريع أو المشكلات غير الصالحة**
- تحقق جيداً من مفاتيح المشاريع ومفاتيح المشكلات للتأكد من صحة الصيغة (مثال: "PROJ-123")
- تأكد من وجود المشاريع وإمكانية الوصول إليها من حسابك
**مشاكل استعلام JQL**
- اختبر استعلامات JQL في بحث مشكلات Jira قبل استخدامها في استدعاءات API
- تأكد من صحة إملاء أسماء الحقول في JQL ووجودها في مثيل Jira الخاص بك
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل Jira أو
استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,261 @@
---
title: تكامل Linear
description: "إدارة المشاريع البرمجية وتتبع الأخطاء مع تكامل Linear لـ CrewAI."
icon: "list-check"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إدارة المشكلات والمشاريع وسير عمل التطوير عبر Linear. أنشئ المشكلات وحدّثها، وأدر جداول المشاريع الزمنية، ونظّم الفرق، وبسّط عملية تطوير البرمجيات باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Linear، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Linear بصلاحيات مساحة العمل المناسبة
- ربط حساب Linear الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Linear
### 1. ربط حساب Linear الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Linear** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة لإدارة المشكلات والمشاريع
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="linear/create_issue">
**الوصف:** إنشاء مشكلة جديدة في Linear.
**المعاملات:**
- `teamId` (string, مطلوب): معرّف الفريق للمشكلة الجديدة.
- `title` (string, مطلوب): العنوان.
- `description` (string, اختياري): الوصف.
- `statusId` (string, اختياري): الحالة.
- `priority` (string, اختياري): الأولوية كعدد صحيح.
- `dueDate` (string, اختياري): تاريخ الاستحقاق بصيغة ISO 8601.
- `cycleId` (string, اختياري): معرّف الدورة المرتبطة.
- `additionalFields` (object, اختياري): حقول إضافية.
</Accordion>
<Accordion title="linear/update_issue">
**الوصف:** تحديث مشكلة في Linear.
**المعاملات:**
- `issueId` (string, مطلوب): معرّف المشكلة المراد تحديثها.
- `title` (string, اختياري): العنوان.
- `description` (string, اختياري): الوصف.
- `statusId` (string, اختياري): الحالة.
- `priority` (string, اختياري): الأولوية.
- `dueDate` (string, اختياري): تاريخ الاستحقاق.
</Accordion>
<Accordion title="linear/get_issue_by_id">
**الوصف:** الحصول على مشكلة بواسطة المعرّف في Linear.
**المعاملات:**
- `issueId` (string, مطلوب): معرّف المشكلة المراد جلبها.
</Accordion>
<Accordion title="linear/search_issue">
**الوصف:** البحث عن المشكلات في Linear.
**المعاملات:**
- `queryTerm` (string, مطلوب): مصطلح البحث.
- `issueFilterFormula` (object, اختياري): فلتر بصيغة التعبير العادي المنفصل.
</Accordion>
<Accordion title="linear/delete_issue">
**الوصف:** حذف مشكلة في Linear.
**المعاملات:**
- `issueId` (string, مطلوب): معرّف المشكلة المراد حذفها.
</Accordion>
<Accordion title="linear/archive_issue">
**الوصف:** أرشفة مشكلة في Linear.
**المعاملات:**
- `issueId` (string, مطلوب): معرّف المشكلة المراد أرشفتها.
</Accordion>
<Accordion title="linear/create_sub_issue">
**الوصف:** إنشاء مشكلة فرعية في Linear.
**المعاملات:**
- `parentId` (string, مطلوب): معرّف المشكلة الأصلية.
- `teamId` (string, مطلوب): معرّف الفريق.
- `title` (string, مطلوب): العنوان.
- `description` (string, اختياري): الوصف.
</Accordion>
<Accordion title="linear/create_project">
**الوصف:** إنشاء مشروع جديد في Linear.
**المعاملات:**
- `teamIds` (object, مطلوب): معرّف (معرّفات) الفريق المرتبطة بالمشروع.
- `projectName` (string, مطلوب): اسم المشروع.
- `description` (string, اختياري): وصف المشروع.
</Accordion>
<Accordion title="linear/update_project">
**الوصف:** تحديث مشروع في Linear.
**المعاملات:**
- `projectId` (string, مطلوب): معرّف المشروع المراد تحديثه.
- `projectName` (string, اختياري): اسم المشروع.
- `description` (string, اختياري): وصف المشروع.
</Accordion>
<Accordion title="linear/get_project_by_id">
**الوصف:** الحصول على مشروع بواسطة المعرّف في Linear.
**المعاملات:**
- `projectId` (string, مطلوب): معرّف المشروع المراد جلبه.
</Accordion>
<Accordion title="linear/delete_project">
**الوصف:** حذف مشروع في Linear.
**المعاملات:**
- `projectId` (string, مطلوب): معرّف المشروع المراد حذفه.
</Accordion>
<Accordion title="linear/search_teams">
**الوصف:** البحث عن الفرق في Linear.
**المعاملات:**
- `teamFilterFormula` (object, اختياري): فلتر بصيغة التعبير العادي المنفصل.
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ Linear
```python
from crewai import Agent, Task, Crew
from crewai import Agent, Task, Crew
# Create an agent with Linear capabilities
linear_agent = Agent(
role="Development Manager",
goal="Manage Linear issues and track development progress efficiently",
backstory="An AI assistant specialized in software development project management.",
apps=['linear'] # All Linear actions will be available
)
# Task to create a bug report
create_bug_task = Task(
description="Create a high-priority bug report for the authentication system and assign it to the backend team",
agent=linear_agent,
expected_output="Bug report created successfully with issue ID"
)
# Run the task
crew = Crew(
agents=[linear_agent],
tasks=[create_bug_task]
)
crew.kickoff()
```
### إدارة المشاريع والفرق
```python
from crewai import Agent, Task, Crew
project_coordinator = Agent(
role="Project Coordinator",
goal="Coordinate projects and teams in Linear efficiently",
backstory="An experienced project coordinator who manages development cycles and team workflows.",
apps=['linear']
)
# Task to coordinate project setup
project_coordination = Task(
description="""
1. Search for engineering teams in Linear
2. Create a new project for Q2 feature development
3. Associate the project with relevant teams
4. Create initial project milestones as issues
""",
agent=project_coordinator,
expected_output="Q2 project created with teams assigned and initial milestones established"
)
crew = Crew(
agents=[project_coordinator],
tasks=[project_coordination]
)
crew.kickoff()
```
## استكشاف الأخطاء وإصلاحها
### المشاكل الشائعة
**أخطاء الصلاحيات**
- تأكد من أن حساب Linear الخاص بك لديه الصلاحيات اللازمة لمساحة العمل المستهدفة
- تحقق من أن اتصال OAuth يتضمن النطاقات المطلوبة لـ Linear API
**معرّفات ومراجع غير صالحة**
- تحقق جيداً من معرّفات الفرق والمشكلات والمشاريع للتأكد من صحة صيغة UUID
- تأكد من وجود الكيانات المشار إليها وإمكانية الوصول إليها
**مشاكل التاريخ والوقت**
- استخدم صيغة ISO 8601 لتواريخ الاستحقاق والطوابع الزمنية
- تأكد من معالجة المناطق الزمنية بشكل صحيح
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل Linear أو
استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,269 @@
---
title: تكامل Microsoft Excel
description: "إدارة المصنفات والبيانات مع تكامل Microsoft Excel لـ CrewAI."
icon: "table"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من إنشاء وإدارة مصنفات Excel وأوراق العمل والجداول والرسوم البيانية في OneDrive أو SharePoint. تعامل مع نطاقات البيانات، وأنشئ المرئيات، وأدر الجداول، وبسّط سير عمل جداول البيانات باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Microsoft Excel، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Microsoft 365 مع إمكانية الوصول إلى Excel وOneDrive/SharePoint
- ربط حساب Microsoft الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Microsoft Excel
### 1. ربط حساب Microsoft الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Microsoft Excel** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة للوصول إلى الملفات ومصنفات Excel
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="microsoft_excel/create_workbook">
**الوصف:** إنشاء مصنف Excel جديد في OneDrive أو SharePoint.
**المعاملات:**
- `file_path` (string, مطلوب): المسار حيث يتم إنشاء المصنف (مثال: 'MyWorkbook.xlsx')
- `worksheets` (array, اختياري): أوراق العمل الأولية المراد إنشاؤها
</Accordion>
<Accordion title="microsoft_excel/get_workbooks">
**الوصف:** الحصول على جميع مصنفات Excel من OneDrive أو SharePoint.
**المعاملات:**
- `select` (string, اختياري): اختيار خصائص محددة للإرجاع
- `filter` (string, اختياري): تصفية النتائج باستخدام صيغة OData
- `top` (integer, اختياري): عدد العناصر المراد إرجاعها. الحد الأدنى: 1، الحد الأقصى: 999
</Accordion>
<Accordion title="microsoft_excel/get_worksheets">
**الوصف:** الحصول على جميع أوراق العمل في مصنف Excel.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
</Accordion>
<Accordion title="microsoft_excel/create_worksheet">
**الوصف:** إنشاء ورقة عمل جديدة في مصنف Excel.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
- `name` (string, مطلوب): اسم ورقة العمل الجديدة
</Accordion>
<Accordion title="microsoft_excel/get_range_data">
**الوصف:** الحصول على البيانات من نطاق محدد في ورقة عمل Excel.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
- `worksheet_name` (string, مطلوب): اسم ورقة العمل
- `range` (string, مطلوب): عنوان النطاق (مثال: 'A1:C10')
</Accordion>
<Accordion title="microsoft_excel/update_range_data">
**الوصف:** تحديث البيانات في نطاق محدد في ورقة عمل Excel.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
- `worksheet_name` (string, مطلوب): اسم ورقة العمل
- `range` (string, مطلوب): عنوان النطاق (مثال: 'A1:C10')
- `values` (array, مطلوب): مصفوفة ثنائية الأبعاد من القيم لتعيينها في النطاق
</Accordion>
<Accordion title="microsoft_excel/add_table">
**الوصف:** إنشاء جدول في ورقة عمل Excel.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
- `worksheet_name` (string, مطلوب): اسم ورقة العمل
- `range` (string, مطلوب): النطاق للجدول (مثال: 'A1:D10')
- `has_headers` (boolean, اختياري): ما إذا كان الصف الأول يحتوي على ترويسات. الافتراضي: true
</Accordion>
<Accordion title="microsoft_excel/add_table_row">
**الوصف:** إضافة صف جديد إلى جدول Excel.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
- `worksheet_name` (string, مطلوب): اسم ورقة العمل
- `table_name` (string, مطلوب): اسم الجدول
- `values` (array, مطلوب): مصفوفة من القيم للصف الجديد
</Accordion>
<Accordion title="microsoft_excel/create_chart">
**الوصف:** إنشاء رسم بياني في ورقة عمل Excel.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
- `worksheet_name` (string, مطلوب): اسم ورقة العمل
- `chart_type` (string, مطلوب): نوع الرسم البياني (مثال: 'ColumnClustered', 'Line', 'Pie')
- `source_data` (string, مطلوب): نطاق البيانات للرسم البياني (مثال: 'A1:B10')
- `series_by` (string, اختياري): كيفية تفسير البيانات ('Auto', 'Columns', 'Rows'). الافتراضي: Auto
</Accordion>
<Accordion title="microsoft_excel/get_cell">
**الوصف:** الحصول على قيمة خلية واحدة في ورقة عمل Excel.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
- `worksheet_name` (string, مطلوب): اسم ورقة العمل
- `row` (integer, مطلوب): رقم الصف (قائم على الصفر)
- `column` (integer, مطلوب): رقم العمود (قائم على الصفر)
</Accordion>
<Accordion title="microsoft_excel/get_used_range">
**الوصف:** الحصول على النطاق المستخدم لورقة عمل Excel (يحتوي على جميع البيانات).
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
- `worksheet_name` (string, مطلوب): اسم ورقة العمل
</Accordion>
<Accordion title="microsoft_excel/get_tables">
**الوصف:** الحصول على جميع الجداول في ورقة عمل Excel.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
- `worksheet_name` (string, مطلوب): اسم ورقة العمل
</Accordion>
<Accordion title="microsoft_excel/get_table_data">
**الوصف:** الحصول على البيانات من جدول محدد في ورقة عمل Excel.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
- `worksheet_name` (string, مطلوب): اسم ورقة العمل
- `table_name` (string, مطلوب): اسم الجدول
</Accordion>
<Accordion title="microsoft_excel/delete_worksheet">
**الوصف:** حذف ورقة عمل من مصنف Excel.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
- `worksheet_name` (string, مطلوب): اسم ورقة العمل المراد حذفها
</Accordion>
<Accordion title="microsoft_excel/delete_table">
**الوصف:** حذف جدول من ورقة عمل Excel.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
- `worksheet_name` (string, مطلوب): اسم ورقة العمل
- `table_name` (string, مطلوب): اسم الجدول المراد حذفه
</Accordion>
<Accordion title="microsoft_excel/list_names">
**الوصف:** الحصول على جميع النطاقات المسماة في مصنف Excel.
**المعاملات:**
- `file_id` (string, مطلوب): معرّف ملف Excel
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ Excel
```python
from crewai import Agent, Task, Crew
# Create an agent with Excel capabilities
excel_agent = Agent(
role="Excel Data Manager",
goal="Manage Excel workbooks and data efficiently",
backstory="An AI assistant specialized in Excel data management and analysis.",
apps=['microsoft_excel'] # All Excel actions will be available
)
# Task to create and populate a workbook
data_management_task = Task(
description="Create a new sales report workbook with data analysis and charts",
agent=excel_agent,
expected_output="Excel workbook created with sales data, analysis, and visualizations"
)
# Run the task
crew = Crew(
agents=[excel_agent],
tasks=[data_management_task]
)
crew.kickoff()
```
## استكشاف الأخطاء وإصلاحها
### المشاكل الشائعة
**أخطاء الصلاحيات**
- تأكد من أن حساب Microsoft الخاص بك لديه الصلاحيات المناسبة لـ Excel وOneDrive/SharePoint
- تحقق من أن اتصال OAuth يتضمن النطاقات المطلوبة (Files.Read.All, Files.ReadWrite.All)
**مشاكل النطاق وورقة العمل**
- تحقق من وجود أسماء أوراق العمل في المصنف المحدد
- تأكد من صحة تنسيق عناوين النطاقات (مثال: 'A1:C10')
**مشاكل الرسوم البيانية**
- تحقق من دعم أنواع الرسوم البيانية (ColumnClustered, Line, Pie، إلخ.)
- تأكد من أن نطاقات بيانات المصدر تحتوي على بيانات مناسبة لنوع الرسم البياني
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل Microsoft Excel
أو استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,218 @@
---
title: تكامل Microsoft OneDrive
description: "إدارة الملفات والمجلدات مع تكامل Microsoft OneDrive لـ CrewAI."
icon: "cloud"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من رفع وتحميل وإدارة الملفات والمجلدات في Microsoft OneDrive. أتمت عمليات الملفات، ونظّم المحتوى، وأنشئ روابط المشاركة، وبسّط سير عمل التخزين السحابي باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Microsoft OneDrive، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Microsoft مع إمكانية الوصول إلى OneDrive
- ربط حساب Microsoft الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Microsoft OneDrive
### 1. ربط حساب Microsoft الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Microsoft OneDrive** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة للوصول إلى الملفات
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="microsoft_onedrive/list_files">
**الوصف:** عرض الملفات والمجلدات في OneDrive.
**المعاملات:**
- `top` (integer, اختياري): عدد العناصر المراد استرجاعها (الحد الأقصى 1000). الافتراضي: `50`.
- `orderby` (string, اختياري): الترتيب حسب حقل (مثال: "name asc", "lastModifiedDateTime desc"). الافتراضي: "name asc".
- `filter` (string, اختياري): تعبير فلتر OData.
</Accordion>
<Accordion title="microsoft_onedrive/get_file_info">
**الوصف:** الحصول على معلومات حول ملف أو مجلد محدد.
**المعاملات:**
- `item_id` (string, مطلوب): معرّف الملف أو المجلد.
</Accordion>
<Accordion title="microsoft_onedrive/download_file">
**الوصف:** تحميل ملف من OneDrive.
**المعاملات:**
- `item_id` (string, مطلوب): معرّف الملف المراد تحميله.
</Accordion>
<Accordion title="microsoft_onedrive/upload_file">
**الوصف:** رفع ملف إلى OneDrive.
**المعاملات:**
- `file_name` (string, مطلوب): اسم الملف المراد رفعه.
- `content` (string, مطلوب): محتوى الملف بترميز Base64.
</Accordion>
<Accordion title="microsoft_onedrive/create_folder">
**الوصف:** إنشاء مجلد جديد في OneDrive.
**المعاملات:**
- `folder_name` (string, مطلوب): اسم المجلد المراد إنشاؤه.
</Accordion>
<Accordion title="microsoft_onedrive/delete_item">
**الوصف:** حذف ملف أو مجلد من OneDrive.
**المعاملات:**
- `item_id` (string, مطلوب): معرّف الملف أو المجلد المراد حذفه.
</Accordion>
<Accordion title="microsoft_onedrive/copy_item">
**الوصف:** نسخ ملف أو مجلد في OneDrive.
**المعاملات:**
- `item_id` (string, مطلوب): معرّف الملف أو المجلد المراد نسخه.
- `parent_id` (string, اختياري): معرّف مجلد الوجهة (اختياري، الافتراضي هو الجذر).
- `new_name` (string, اختياري): الاسم الجديد للعنصر المنسوخ (اختياري).
</Accordion>
<Accordion title="microsoft_onedrive/move_item">
**الوصف:** نقل ملف أو مجلد في OneDrive.
**المعاملات:**
- `item_id` (string, مطلوب): معرّف الملف أو المجلد المراد نقله.
- `parent_id` (string, مطلوب): معرّف مجلد الوجهة.
- `new_name` (string, اختياري): الاسم الجديد للعنصر (اختياري).
</Accordion>
<Accordion title="microsoft_onedrive/search_files">
**الوصف:** البحث عن الملفات والمجلدات في OneDrive.
**المعاملات:**
- `query` (string, مطلوب): سلسلة استعلام البحث.
- `top` (integer, اختياري): عدد النتائج المراد إرجاعها (الحد الأقصى 1000). الافتراضي: `50`.
</Accordion>
<Accordion title="microsoft_onedrive/share_item">
**الوصف:** إنشاء رابط مشاركة لملف أو مجلد.
**المعاملات:**
- `item_id` (string, مطلوب): معرّف الملف أو المجلد المراد مشاركته.
- `type` (string, اختياري): نوع رابط المشاركة. القيم: `view`, `edit`, `embed`. الافتراضي: `view`.
- `scope` (string, اختياري): نطاق رابط المشاركة. القيم: `anonymous`, `organization`. الافتراضي: `anonymous`.
</Accordion>
<Accordion title="microsoft_onedrive/get_recent_files">
**الوصف:** الحصول على الملفات التي تم الوصول إليها مؤخراً من OneDrive.
**المعاملات:**
- `top` (integer, اختياري): عدد العناصر المراد استرجاعها (الحد الأقصى 200). الافتراضي: `25`.
</Accordion>
<Accordion title="microsoft_onedrive/get_shared_with_me">
**الوصف:** الحصول على الملفات والمجلدات المشاركة مع المستخدم.
**المعاملات:**
- `top` (integer, اختياري): عدد العناصر المراد استرجاعها (الحد الأقصى 200). الافتراضي: `50`.
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ Microsoft OneDrive
```python
from crewai import Agent, Task, Crew
# Create an agent with Microsoft OneDrive capabilities
onedrive_agent = Agent(
role="File Manager",
goal="Manage files and folders in OneDrive efficiently",
backstory="An AI assistant specialized in Microsoft OneDrive file operations and organization.",
apps=['microsoft_onedrive'] # All OneDrive actions will be available
)
# Task to list files and create a folder
organize_files_task = Task(
description="List all files in my OneDrive root directory and create a new folder called 'Project Documents'.",
agent=onedrive_agent,
expected_output="List of files displayed and new folder 'Project Documents' created."
)
# Run the task
crew = Crew(
agents=[onedrive_agent],
tasks=[organize_files_task]
)
crew.kickoff()
```
## استكشاف الأخطاء وإصلاحها
### المشاكل الشائعة
**أخطاء المصادقة**
- تأكد من أن حساب Microsoft الخاص بك لديه الصلاحيات اللازمة للوصول إلى الملفات (مثال: `Files.Read`, `Files.ReadWrite`).
- تحقق من أن اتصال OAuth يتضمن جميع النطاقات المطلوبة.
**مشاكل رفع الملفات**
- تأكد من توفير `file_name` و`content` لعمليات رفع الملفات.
- يجب أن يكون المحتوى بترميز Base64 للملفات الثنائية.
**عمليات الملفات (النسخ/النقل)**
- لـ `move_item`، تأكد من توفير كل من `item_id` و`parent_id`.
- تحقق من وجود مجلدات الوجهة وإمكانية الوصول إليها.
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل Microsoft OneDrive
أو استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,227 @@
---
title: تكامل Microsoft Outlook
description: "إدارة البريد الإلكتروني والتقويم وجهات الاتصال مع تكامل Microsoft Outlook لـ CrewAI."
icon: "envelope"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من الوصول إلى رسائل Outlook الإلكترونية وأحداث التقويم وجهات الاتصال وإدارتها. أرسل رسائل البريد الإلكتروني، واسترجع الرسائل، وأدر أحداث التقويم، ونظّم جهات الاتصال باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Microsoft Outlook، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Microsoft مع إمكانية الوصول إلى Outlook
- ربط حساب Microsoft الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Microsoft Outlook
### 1. ربط حساب Microsoft الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Microsoft Outlook** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة للوصول إلى البريد والتقويم وجهات الاتصال
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="microsoft_outlook/get_messages">
**الوصف:** الحصول على رسائل البريد الإلكتروني من صندوق بريد المستخدم.
**المعاملات:**
- `top` (integer, اختياري): عدد الرسائل (الحد الأقصى 1000). الافتراضي: `10`.
- `filter` (string, اختياري): تعبير فلتر OData (مثال: "isRead eq false").
- `search` (string, اختياري): سلسلة استعلام البحث.
- `orderby` (string, اختياري): الترتيب (مثال: "receivedDateTime desc"). الافتراضي: "receivedDateTime desc".
</Accordion>
<Accordion title="microsoft_outlook/send_email">
**الوصف:** إرسال رسالة بريد إلكتروني.
**المعاملات:**
- `to_recipients` (array, مطلوب): مصفوفة عناوين المستلمين.
- `subject` (string, مطلوب): موضوع البريد الإلكتروني.
- `body` (string, مطلوب): محتوى البريد الإلكتروني.
- `body_type` (string, اختياري): نوع المحتوى. القيم: `Text`, `HTML`. الافتراضي: `HTML`.
- `importance` (string, اختياري): مستوى الأهمية. القيم: `low`, `normal`, `high`. الافتراضي: `normal`.
- `cc_recipients` (array, اختياري): مصفوفة عناوين النسخة الكربونية.
</Accordion>
<Accordion title="microsoft_outlook/get_calendar_events">
**الوصف:** الحصول على أحداث التقويم من تقويم المستخدم.
**المعاملات:**
- `top` (integer, اختياري): عدد الأحداث (الحد الأقصى 1000). الافتراضي: `10`.
- `filter` (string, اختياري): تعبير فلتر OData.
- `orderby` (string, اختياري): الترتيب. الافتراضي: "start/dateTime asc".
</Accordion>
<Accordion title="microsoft_outlook/create_calendar_event">
**الوصف:** إنشاء حدث تقويم جديد.
**المعاملات:**
- `subject` (string, مطلوب): موضوع/عنوان الحدث.
- `start_datetime` (string, مطلوب): وقت البداية بصيغة ISO 8601.
- `end_datetime` (string, مطلوب): وقت النهاية بصيغة ISO 8601.
- `timezone` (string, اختياري): المنطقة الزمنية. الافتراضي: `UTC`.
- `location` (string, اختياري): موقع الحدث.
- `attendees` (array, اختياري): مصفوفة عناوين الحضور.
</Accordion>
<Accordion title="microsoft_outlook/get_contacts">
**الوصف:** الحصول على جهات الاتصال من دفتر عناوين المستخدم.
**المعاملات:**
- `top` (integer, اختياري): عدد جهات الاتصال (الحد الأقصى 1000). الافتراضي: `10`.
- `filter` (string, اختياري): تعبير فلتر OData.
</Accordion>
<Accordion title="microsoft_outlook/create_contact">
**الوصف:** إنشاء جهة اتصال جديدة في دفتر عناوين المستخدم.
**المعاملات:**
- `displayName` (string, مطلوب): اسم العرض لجهة الاتصال.
- `givenName` (string, اختياري): الاسم الأول.
- `surname` (string, اختياري): اسم العائلة.
- `emailAddresses` (array, اختياري): مصفوفة عناوين البريد الإلكتروني.
- `jobTitle` (string, اختياري): المسمى الوظيفي.
- `companyName` (string, اختياري): اسم الشركة.
</Accordion>
<Accordion title="microsoft_outlook/reply_to_email">
**الوصف:** الرد على رسالة بريد إلكتروني.
**المعاملات:**
- `message_id` (string, مطلوب): المعرّف الفريد للرسالة المراد الرد عليها.
- `comment` (string, مطلوب): محتوى الرد.
</Accordion>
<Accordion title="microsoft_outlook/forward_email">
**الوصف:** إعادة توجيه رسالة بريد إلكتروني.
**المعاملات:**
- `message_id` (string, مطلوب): المعرّف الفريد للرسالة المراد إعادة توجيهها.
- `to_recipients` (array, مطلوب): مصفوفة عناوين المستلمين.
- `comment` (string, اختياري): رسالة اختيارية لتضمينها فوق المحتوى المُعاد توجيهه.
</Accordion>
<Accordion title="microsoft_outlook/delete_message">
**الوصف:** حذف رسالة بريد إلكتروني.
**المعاملات:**
- `message_id` (string, مطلوب): المعرّف الفريد للرسالة المراد حذفها.
</Accordion>
<Accordion title="microsoft_outlook/update_event">
**الوصف:** تحديث حدث تقويم موجود.
**المعاملات:**
- `event_id` (string, مطلوب): المعرّف الفريد للحدث.
- `subject` (string, اختياري): الموضوع/العنوان الجديد.
- `start_time` (string, اختياري): وقت البداية الجديد بصيغة ISO 8601.
- `location` (string, اختياري): الموقع الجديد.
</Accordion>
<Accordion title="microsoft_outlook/delete_event">
**الوصف:** حذف حدث تقويم.
**المعاملات:**
- `event_id` (string, مطلوب): المعرّف الفريد للحدث المراد حذفه.
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ Microsoft Outlook
```python
from crewai import Agent, Task, Crew
# Create an agent with Microsoft Outlook capabilities
outlook_agent = Agent(
role="Email Assistant",
goal="Manage emails, calendar events, and contacts efficiently",
backstory="An AI assistant specialized in Microsoft Outlook operations and communication management.",
apps=['microsoft_outlook'] # All Outlook actions will be available
)
# Task to send an email
send_email_task = Task(
description="Send an email to 'colleague@example.com' with subject 'Project Update' and body 'Hi, here is the latest project update. Best regards.'",
agent=outlook_agent,
expected_output="Email sent successfully to colleague@example.com"
)
# Run the task
crew = Crew(
agents=[outlook_agent],
tasks=[send_email_task]
)
crew.kickoff()
```
## استكشاف الأخطاء وإصلاحها
### المشاكل الشائعة
**أخطاء المصادقة**
- تأكد من أن حساب Microsoft الخاص بك لديه الصلاحيات اللازمة للوصول إلى البريد والتقويم وجهات الاتصال.
- النطاقات المطلوبة تشمل: `Mail.Read`, `Mail.Send`, `Calendars.ReadWrite`, `Contacts.ReadWrite`.
**مشاكل إرسال البريد الإلكتروني**
- تأكد من توفير `to_recipients` و`subject` و`body` لـ `send_email`.
- تحقق من صحة صيغة عناوين البريد الإلكتروني.
**إنشاء أحداث التقويم**
- تأكد من توفير `subject` و`start_datetime` و`end_datetime`.
- استخدم صيغة ISO 8601 المناسبة لحقول التاريخ والوقت.
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل Microsoft Outlook
أو استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,270 @@
---
title: تكامل Microsoft SharePoint
description: "إدارة المواقع والقوائم والمستندات مع تكامل Microsoft SharePoint لـ CrewAI."
icon: "folder-tree"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من الوصول إلى مواقع SharePoint والقوائم ومكتبات المستندات وإدارتها. استرجع معلومات المواقع، وأدر عناصر القوائم، وارفع الملفات ونظّمها، وبسّط سير عمل SharePoint باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Microsoft SharePoint، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Microsoft 365 مع إمكانية الوصول إلى SharePoint
- ربط حساب Microsoft الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Microsoft SharePoint
### 1. ربط حساب Microsoft الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Microsoft SharePoint** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة للوصول إلى مواقع SharePoint ومحتوياتها
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="microsoft_sharepoint/get_sites">
**الوصف:** الحصول على جميع مواقع SharePoint التي يمكن للمستخدم الوصول إليها.
**المعاملات:**
- `search` (string, اختياري): استعلام بحث لتصفية المواقع
- `top` (integer, اختياري): عدد العناصر المراد إرجاعها. الحد الأدنى: 1، الحد الأقصى: 999
</Accordion>
<Accordion title="microsoft_sharepoint/get_site">
**الوصف:** الحصول على معلومات حول موقع SharePoint محدد.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint
</Accordion>
<Accordion title="microsoft_sharepoint/get_drives">
**الوصف:** عرض جميع مكتبات المستندات (drives) في موقع SharePoint.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint الكامل
</Accordion>
<Accordion title="microsoft_sharepoint/get_site_lists">
**الوصف:** الحصول على جميع القوائم في موقع SharePoint.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint
</Accordion>
<Accordion title="microsoft_sharepoint/get_list_items">
**الوصف:** الحصول على عناصر من قائمة SharePoint.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint
- `list_id` (string, مطلوب): معرّف القائمة
- `expand` (string, اختياري): توسيع البيانات المرتبطة (مثال: 'fields')
</Accordion>
<Accordion title="microsoft_sharepoint/create_list_item">
**الوصف:** إنشاء عنصر جديد في قائمة SharePoint.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint
- `list_id` (string, مطلوب): معرّف القائمة
- `fields` (object, مطلوب): قيم الحقول للعنصر الجديد
</Accordion>
<Accordion title="microsoft_sharepoint/update_list_item">
**الوصف:** تحديث عنصر في قائمة SharePoint.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint
- `list_id` (string, مطلوب): معرّف القائمة
- `item_id` (string, مطلوب): معرّف العنصر المراد تحديثه
- `fields` (object, مطلوب): قيم الحقول المراد تحديثها
</Accordion>
<Accordion title="microsoft_sharepoint/delete_list_item">
**الوصف:** حذف عنصر من قائمة SharePoint.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint
- `list_id` (string, مطلوب): معرّف القائمة
- `item_id` (string, مطلوب): معرّف العنصر المراد حذفه
</Accordion>
<Accordion title="microsoft_sharepoint/upload_file_to_library">
**الوصف:** رفع ملف إلى مكتبة مستندات SharePoint.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint
- `file_path` (string, مطلوب): المسار حيث يتم رفع الملف
- `content` (string, مطلوب): محتوى الملف المراد رفعه
</Accordion>
<Accordion title="microsoft_sharepoint/list_files">
**الوصف:** استرجاع الملفات والمجلدات من مكتبة مستندات SharePoint.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint الكامل
- `drive_id` (string, مطلوب): معرّف مكتبة المستندات
- `folder_id` (string, اختياري): معرّف المجلد. الافتراضي: 'root'
- `top` (integer, اختياري): الحد الأقصى لعدد العناصر. الافتراضي: 50
</Accordion>
<Accordion title="microsoft_sharepoint/search_files">
**الوصف:** البحث عن الملفات والمجلدات في مكتبة مستندات SharePoint بالكلمات المفتاحية.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint الكامل
- `drive_id` (string, مطلوب): معرّف مكتبة المستندات
- `query` (string, مطلوب): كلمات البحث المفتاحية
</Accordion>
<Accordion title="microsoft_sharepoint/delete_file">
**الوصف:** حذف ملف أو مجلد من مكتبة مستندات SharePoint.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint الكامل
- `drive_id` (string, مطلوب): معرّف مكتبة المستندات
- `item_id` (string, مطلوب): المعرّف الفريد للملف أو المجلد المراد حذفه
</Accordion>
<Accordion title="microsoft_sharepoint/create_folder">
**الوصف:** إنشاء مجلد جديد في مكتبة مستندات SharePoint.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint الكامل
- `drive_id` (string, مطلوب): معرّف مكتبة المستندات
- `folder_name` (string, مطلوب): اسم المجلد الجديد
- `parent_id` (string, اختياري): معرّف المجلد الأصلي. الافتراضي: 'root'
</Accordion>
<Accordion title="microsoft_sharepoint/download_file">
**الوصف:** تحميل محتوى ملف خام من مكتبة مستندات SharePoint.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint الكامل
- `drive_id` (string, مطلوب): معرّف مكتبة المستندات
- `item_id` (string, مطلوب): المعرّف الفريد للملف المراد تحميله
</Accordion>
<Accordion title="microsoft_sharepoint/copy_file">
**الوصف:** نسخ ملف أو مجلد إلى موقع جديد داخل SharePoint.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint الكامل
- `drive_id` (string, مطلوب): معرّف مكتبة المستندات
- `item_id` (string, مطلوب): المعرّف الفريد للملف أو المجلد المراد نسخه
- `destination_folder_id` (string, مطلوب): معرّف مجلد الوجهة
</Accordion>
<Accordion title="microsoft_sharepoint/move_file">
**الوصف:** نقل ملف أو مجلد إلى موقع جديد داخل SharePoint.
**المعاملات:**
- `site_id` (string, مطلوب): معرّف موقع SharePoint الكامل
- `drive_id` (string, مطلوب): معرّف مكتبة المستندات
- `item_id` (string, مطلوب): المعرّف الفريد للملف أو المجلد المراد نقله
- `destination_folder_id` (string, مطلوب): معرّف مجلد الوجهة
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ SharePoint
```python
from crewai import Agent, Task, Crew
# Create an agent with SharePoint capabilities
sharepoint_agent = Agent(
role="SharePoint Manager",
goal="Manage SharePoint sites, lists, and documents efficiently",
backstory="An AI assistant specialized in SharePoint content management and collaboration.",
apps=['microsoft_sharepoint'] # All SharePoint actions will be available
)
# Task to organize SharePoint content
content_organization_task = Task(
description="List all accessible SharePoint sites and organize content by department",
agent=sharepoint_agent,
expected_output="SharePoint sites listed and content organized by department"
)
# Run the task
crew = Crew(
agents=[sharepoint_agent],
tasks=[content_organization_task]
)
crew.kickoff()
```
## استكشاف الأخطاء وإصلاحها
### المشاكل الشائعة
**أخطاء الصلاحيات**
- تأكد من أن حساب Microsoft الخاص بك لديه الصلاحيات المناسبة لمواقع SharePoint
- تحقق من أن اتصال OAuth يتضمن النطاقات المطلوبة (Sites.Read.All, Sites.ReadWrite.All)
**مشاكل معرّفات المواقع والقوائم**
- تحقق من صحة معرّفات المواقع والقوائم وصيغتها الصحيحة
- استخدم إجراءات get_sites وget_site_lists لاكتشاف المعرّفات الصالحة
**مشاكل الحقول والمخطط**
- تأكد من تطابق أسماء الحقول تماماً مع مخطط قائمة SharePoint
- تحقق من تضمين الحقول المطلوبة عند إنشاء أو تحديث عناصر القوائم
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل Microsoft SharePoint
أو استكشاف الأخطاء وإصلاحها.
</Card>

View File

@@ -0,0 +1,205 @@
---
title: تكامل Microsoft Teams
description: "التعاون الجماعي والتواصل مع تكامل Microsoft Teams لـ CrewAI."
icon: "users"
mode: "wide"
---
## نظرة عامة
مكّن وكلاءك من الوصول إلى بيانات Teams وإرسال الرسائل وإنشاء الاجتماعات وإدارة القنوات. أتمت التواصل الجماعي، وجدوِل الاجتماعات، واسترجع الرسائل، وبسّط سير عمل التعاون باستخدام الأتمتة المدعومة بالذكاء الاصطناعي.
## المتطلبات الأساسية
قبل استخدام تكامل Microsoft Teams، تأكد من توفر ما يلي:
- حساب [CrewAI AMP](https://app.crewai.com) مع اشتراك فعّال
- حساب Microsoft مع إمكانية الوصول إلى Teams
- ربط حساب Microsoft الخاص بك عبر [صفحة التكاملات](https://app.crewai.com/crewai_plus/connectors)
## إعداد تكامل Microsoft Teams
### 1. ربط حساب Microsoft الخاص بك
1. انتقل إلى [تكاملات CrewAI AMP](https://app.crewai.com/crewai_plus/connectors)
2. ابحث عن **Microsoft Teams** في قسم تكاملات المصادقة
3. انقر على **Connect** وأكمل عملية OAuth
4. امنح الصلاحيات اللازمة للوصول إلى Teams
5. انسخ رمز المؤسسة من [إعدادات التكامل](https://app.crewai.com/crewai_plus/settings/integrations)
### 2. تثبيت الحزمة المطلوبة
```bash
uv add crewai-tools
```
### 3. إعداد متغير البيئة
<Note>
لاستخدام التكاملات مع `Agent(apps=[])`, يجب تعيين متغير البيئة
`CREWAI_PLATFORM_INTEGRATION_TOKEN` برمز المؤسسة الخاص بك.
</Note>
```bash
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
```
أو أضفه إلى ملف `.env`:
```
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
```
## الإجراءات المتاحة
<AccordionGroup>
<Accordion title="microsoft_teams/get_teams">
**الوصف:** الحصول على جميع الفرق التي ينتمي إليها المستخدم.
**المعاملات:**
- لا توجد معاملات مطلوبة.
</Accordion>
<Accordion title="microsoft_teams/get_channels">
**الوصف:** الحصول على القنوات في فريق محدد.
**المعاملات:**
- `team_id` (string, مطلوب): معرّف الفريق.
</Accordion>
<Accordion title="microsoft_teams/send_message">
**الوصف:** إرسال رسالة إلى قناة Teams.
**المعاملات:**
- `team_id` (string, مطلوب): معرّف الفريق.
- `channel_id` (string, مطلوب): معرّف القناة.
- `message` (string, مطلوب): محتوى الرسالة.
- `content_type` (string, اختياري): نوع المحتوى (html أو text). الافتراضي: `text`.
</Accordion>
<Accordion title="microsoft_teams/get_messages">
**الوصف:** الحصول على الرسائل من قناة Teams.
**المعاملات:**
- `team_id` (string, مطلوب): معرّف الفريق.
- `channel_id` (string, مطلوب): معرّف القناة.
- `top` (integer, اختياري): عدد الرسائل (الحد الأقصى 50). الافتراضي: `20`.
</Accordion>
<Accordion title="microsoft_teams/create_meeting">
**الوصف:** إنشاء اجتماع Teams.
**المعاملات:**
- `subject` (string, مطلوب): موضوع/عنوان الاجتماع.
- `startDateTime` (string, مطلوب): وقت بداية الاجتماع (صيغة ISO 8601 مع المنطقة الزمنية).
- `endDateTime` (string, مطلوب): وقت نهاية الاجتماع (صيغة ISO 8601 مع المنطقة الزمنية).
</Accordion>
<Accordion title="microsoft_teams/get_team_members">
**الوصف:** الحصول على أعضاء فريق محدد.
**المعاملات:**
- `team_id` (string, مطلوب): المعرّف الفريد للفريق.
- `top` (integer, اختياري): الحد الأقصى لعدد الأعضاء (1-999). الافتراضي: `100`.
</Accordion>
<Accordion title="microsoft_teams/create_channel">
**الوصف:** إنشاء قناة جديدة في فريق.
**المعاملات:**
- `team_id` (string, مطلوب): المعرّف الفريد للفريق.
- `display_name` (string, مطلوب): اسم القناة. الحد الأقصى 50 حرفاً.
- `description` (string, اختياري): وصف اختياري يشرح غرض القناة.
- `membership_type` (string, اختياري): ظهور القناة. القيم: `standard`, `private`. الافتراضي: `standard`.
</Accordion>
<Accordion title="microsoft_teams/reply_to_message">
**الوصف:** الرد على رسالة في قناة Teams.
**المعاملات:**
- `team_id` (string, مطلوب): المعرّف الفريد للفريق.
- `channel_id` (string, مطلوب): المعرّف الفريد للقناة.
- `message_id` (string, مطلوب): المعرّف الفريد للرسالة المراد الرد عليها.
- `message` (string, مطلوب): محتوى الرد.
- `content_type` (string, اختياري): صيغة المحتوى. القيم: `html`, `text`. الافتراضي: `text`.
</Accordion>
<Accordion title="microsoft_teams/update_meeting">
**الوصف:** تحديث اجتماع عبر الإنترنت موجود.
**المعاملات:**
- `meeting_id` (string, مطلوب): المعرّف الفريد للاجتماع.
- `subject` (string, اختياري): عنوان الاجتماع الجديد.
- `startDateTime` (string, اختياري): وقت البداية الجديد بصيغة ISO 8601.
- `endDateTime` (string, اختياري): وقت النهاية الجديد بصيغة ISO 8601.
</Accordion>
<Accordion title="microsoft_teams/delete_meeting">
**الوصف:** حذف اجتماع عبر الإنترنت.
**المعاملات:**
- `meeting_id` (string, مطلوب): المعرّف الفريد للاجتماع المراد حذفه.
</Accordion>
</AccordionGroup>
## أمثلة الاستخدام
### إعداد Agent أساسي لـ Microsoft Teams
```python
from crewai import Agent, Task, Crew
# Create an agent with Microsoft Teams capabilities
teams_agent = Agent(
role="Teams Coordinator",
goal="Manage Teams communication and meetings efficiently",
backstory="An AI assistant specialized in Microsoft Teams operations and team collaboration.",
apps=['microsoft_teams'] # All Teams actions will be available
)
# Task to list teams and channels
explore_teams_task = Task(
description="List all teams I'm a member of and then get the channels for the first team.",
agent=teams_agent,
expected_output="List of teams and channels displayed."
)
# Run the task
crew = Crew(
agents=[teams_agent],
tasks=[explore_teams_task]
)
crew.kickoff()
```
## استكشاف الأخطاء وإصلاحها
### المشاكل الشائعة
**أخطاء المصادقة**
- تأكد من أن حساب Microsoft الخاص بك لديه الصلاحيات اللازمة للوصول إلى Teams.
- النطاقات المطلوبة تشمل: `Team.ReadBasic.All`, `Channel.ReadBasic.All`, `ChannelMessage.Send`, `OnlineMeetings.ReadWrite`.
**إنشاء الاجتماعات**
- تأكد من توفير `subject` و`startDateTime` و`endDateTime`.
- استخدم صيغة ISO 8601 مع المنطقة الزمنية لحقول التاريخ والوقت.
### الحصول على المساعدة
<Card title="تحتاج مساعدة؟" icon="headset" href="mailto:support@crewai.com">
تواصل مع فريق الدعم للحصول على المساعدة في إعداد تكامل Microsoft Teams
أو استكشاف الأخطاء وإصلاحها.
</Card>

Some files were not shown because too many files have changed in this diff Show More