You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "wenjin272 (via GitHub)" <gi...@apache.org> on 2026/01/14 07:39:55 UTC
[PR] [api ]Provide constant to point a resource to avoid importing integration package. [flink-agents]
wenjin272 opened a new pull request, #433:
URL: https://github.com/apache/flink-agents/pull/433
<!--
* 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: #432
### Purpose of change
Provide constant to point a resource to avoid importing integration package.
### Tests
existing tests
### API
Yes, python `ResourceDescriptor` use class name(including module) rather than class to point a resource implementation.
### Documentation
<!-- Do not remove this section. Check the proper box only. -->
- [ ] `doc-needed` <!-- Your PR changes impact docs -->
- [ ] `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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [api ]Provide constant to point a resource to avoid importing integration package. [flink-agents]
Posted by "xintongsong (via GitHub)" <gi...@apache.org>.
xintongsong merged PR #433:
URL: https://github.com/apache/flink-agents/pull/433
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [api ]Provide constant to point a resource to avoid importing integration package. [flink-agents]
Posted by "xintongsong (via GitHub)" <gi...@apache.org>.
xintongsong commented on code in PR #433:
URL: https://github.com/apache/flink-agents/pull/433#discussion_r2689714515
##########
api/src/main/java/org/apache/flink/agents/api/resource/Constant.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.agents.api.resource;
+
+/**
+ * Constant strings for pointing a resource implementation in {@link ResourceDescriptor}.
+ *
+ * <p>TODO: Could use service provider interface to simplify the definition of constant in the
+ * future.
+ */
+public class Constant {
+ // Built-in ChatModel
+ // ollama
+ public static String OLLAMA_CHAT_MODEL_CONNECTION =
+ "org.apache.flink.agents.integrations.chatmodels.ollama.OllamaChatModelConnection";
+ public static String OLLAMA_CHAT_MODEL =
Review Comment:
Let's call it `OLLAMA_CHAT_MODEL_SETUP`.
##########
python/flink_agents/api/resource.py:
##########
@@ -198,3 +209,47 @@ def get_resource_class(module_path: str, class_name: str) -> Type[Resource]:
"""
module = importlib.import_module(module_path)
return getattr(module, class_name)
+
+
+class Constant:
+ """Constant strings for pointing a built-in resource implementation."""
+ # Built-in ChatModel
+ # java wrapper
+ JAVA_CHAT_MODEL_CONNECTION = "flink_agents.api.chat_models.java_chat_model.JavaChatModelConnection"
+ JAVA_CHAT_MODEL = "flink_agents.api.chat_models.java_chat_model.JavaChatModelSetup"
Review Comment:
ditto
##########
python/flink_agents/api/resource.py:
##########
@@ -198,3 +209,47 @@ def get_resource_class(module_path: str, class_name: str) -> Type[Resource]:
"""
module = importlib.import_module(module_path)
return getattr(module, class_name)
+
+
+class Constant:
+ """Constant strings for pointing a built-in resource implementation."""
+ # Built-in ChatModel
+ # java wrapper
+ JAVA_CHAT_MODEL_CONNECTION = "flink_agents.api.chat_models.java_chat_model.JavaChatModelConnection"
+ JAVA_CHAT_MODEL = "flink_agents.api.chat_models.java_chat_model.JavaChatModelSetup"
Review Comment:
Why don't we include python resources in the java Constants?
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org