feat: add S2P EoG sample agent and stub eog package#992
Open
UIPath-Harshit wants to merge 1 commit into
Open
Conversation
Add a sample agent at examples/s2p-ontology/agent/ demonstrating the EoG (Explanations over Graphs) pattern on the S2P procurement ontology. Includes graph.py, test script, langgraph.json, and env example. Also adds stub types at src/uipath_langchain/agent/eog/ (OntologyClient, InvestigationConfig, Belief, EoGState, create_eog_agent) so downstream code is importable before the real WU2 implementation lands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
There was a problem hiding this comment.
Pull request overview
Adds an initial “EoG (Explanations over Graphs)” surface to the library plus an S2P ontology example agent, so downstream projects can start importing/typing against the planned API while the real implementation is developed.
Changes:
- Introduces a stub
uipath_langchain.agent.eogmodule exporting placeholder types andcreate_eog_agent(). - Adds an S2P EoG sample agent (graph, runner script, LangGraph config, env template, README) under
examples/s2p-ontology/agent/. - Documents how to run the example locally (with external prerequisites).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/uipath_langchain/agent/eog/init.py | Adds stub EoG API types and a stubbed create_eog_agent() export surface. |
| examples/s2p-ontology/agent/graph.py | Example graph wiring for the S2P EoG agent (LLM + ontology client + graph creation). |
| examples/s2p-ontology/agent/test_eog.py | Script-style runner to execute the compiled graph and print results. |
| examples/s2p-ontology/agent/README.md | Example documentation and expected output description. |
| examples/s2p-ontology/agent/langgraph.json | LangGraph CLI configuration for loading the example graph. |
| examples/s2p-ontology/agent/.env.example | Environment-variable template for local runs. |
Comment on lines
+87
to
+94
| def create_eog_agent( | ||
| model: Any, | ||
| ontology_client: OntologyClient, | ||
| ontology_name: str, | ||
| *, | ||
| investigation_config: InvestigationConfig, | ||
| ) -> StateGraph: | ||
| """Build an EoG investigation graph (uncompiled). |
Comment on lines
+105
to
+108
| raise NotImplementedError( | ||
| "create_eog_agent is a stub. " | ||
| "Install the real eog package (WU2) to use this function." | ||
| ) |
Comment on lines
+17
to
+30
| try: | ||
| from uipath_langchain.chat import UiPathChat | ||
|
|
||
| llm = UiPathChat( | ||
| model=os.getenv("LLM_MODEL", "gpt-4o-2024-08-06"), | ||
| temperature=0.0, | ||
| ) | ||
| except Exception: | ||
| from langchain_openai import ChatOpenAI | ||
|
|
||
| llm = ChatOpenAI( | ||
| model=os.getenv("LLM_MODEL", "gpt-4o-2024-08-06"), | ||
| temperature=0.0, | ||
| ) |
Comment on lines
+59
to
+65
| # Create EoG agent (returns uncompiled StateGraph) | ||
| eog_agent = create_eog_agent( | ||
| model=llm, | ||
| ontology_client=client, | ||
| ontology_name=os.getenv("ONTOLOGY_NAME", "s2p"), | ||
| investigation_config=investigation_config, | ||
| ) |
Comment on lines
+31
to
+37
| 4. **Environment variables** -- copy `.env.example` to `.env` and fill in values | ||
| (or export them directly): | ||
|
|
||
| ```bash | ||
| cp .env.example .env | ||
| ``` | ||
|
|
| { | ||
| "dependencies": ["."], | ||
| "graphs": { | ||
| "agent": "./graph.py:graph" |
Comment on lines
+1
to
+6
| """EoG (Explanations over Graphs) agent package. | ||
|
|
||
| Stubs for the EoG agent API. The real implementation is being built in | ||
| parallel (WU2). These placeholders let downstream code import and type-check | ||
| against the expected surface. | ||
| """ |
Comment on lines
+38
to
+43
| ## Running the test script | ||
|
|
||
| ```bash | ||
| cd examples/s2p-ontology/agent | ||
| python test_eog.py | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
examples/s2p-ontology/agent/that demonstrates graph-guided procurement investigation on the S2P ontologysrc/uipath_langchain/agent/eog/(OntologyClient,InvestigationConfig,Belief,EoGState,create_eog_agent) so downstream code is importable before the real WU2 implementation landsgraph.py,test_eog.pytest script,langgraph.json,.env.example, andREADME.mdTest plan
python -c "from uipath_langchain.agent.eog import create_eog_agent, OntologyClient, InvestigationConfig, EoGState, Belief"🤖 Generated with Claude Code