alnzng opened a new pull request, #475:
URL: https://github.com/apache/flink-agents/pull/475
<!--
* Thank you very much for contributing to Flink Agents.
* Please add the relevant components in the PR title. E.g., [api],
[runtime], [java], [python], [hotfix], etc.
-->
<!-- Please link the PR to the relevant issue(s). Hotfix doesn't need this.
-->
Linked issue: #xxx
### Purpose of change
Changed `Constant.OllamaEmbeddingModelSetup` to
`Constant.OLLAMA_EMBEDDING_MODEL_SETUP` to match the actual constant name
defined in resource.py.
```
/Users/alazhang/Workspaces/Java/flink-agents/python/.venv/bin/python3.11
/Users/alazhang/Workspaces/Java/flink-agents/python/flink_agents/examples/rag/rag_agent_example.py
Starting RAG Example Agent...
Populating ChromaDB with sample knowledge documents...
Knowledge base setup complete! Added 5 documents to ChromaDB.
Traceback (most recent call last):
File
"/Users/alazhang/Workspaces/Java/flink-agents/python/flink_agents/examples/rag/rag_agent_example.py",
line 180, in <module>
output_list = agents_env.from_list(input_list).apply(agent).to_list()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/Users/alazhang/Workspaces/Java/flink-agents/python/flink_agents/runtime/local_execution_environment.py",
line 67, in apply
self.__runner = LocalRunner(agent, self.__config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/Users/alazhang/Workspaces/Java/flink-agents/python/flink_agents/runtime/local_runner.py",
line 281, in __init__
self.__agent_plan = AgentPlan.from_agent(agent, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/Users/alazhang/Workspaces/Java/flink-agents/python/flink_agents/plan/agent_plan.py",
line 139, in from_agent
for provider in _get_resource_providers(agent, config):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/Users/alazhang/Workspaces/Java/flink-agents/python/flink_agents/plan/agent_plan.py",
line 304, in _get_resource_providers
descriptor = value()
^^^^^^^
File
"/Users/alazhang/Workspaces/Java/flink-agents/python/flink_agents/examples/rag/rag_agent_example.py",
line 81, in text_embedder
clazz=Constant.OllamaEmbeddingModelSetup,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'Constant' has no attribute
'OllamaEmbeddingModelSetup'
Process finished with exit code 1
```
### Tests
Run `rag_agent_example.py` locally and verified output
### API
<!-- Does this change touches any public APIs? -->
N/A
### Documentation
<!-- Do not remove this section. Check the proper box only. -->
- [ ] `doc-needed` <!-- Your PR changes impact docs -->
- [X] `doc-not-needed` <!-- Your PR changes do not impact docs -->
- [ ] `doc-included` <!-- Your PR already contains the necessary
documentation updates -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]