Skip to content

PoC: Chat from Github Issue#14

Draft
parjong wants to merge 1 commit intomainfrom
POC/chat_from_github_issues
Draft

PoC: Chat from Github Issue#14
parjong wants to merge 1 commit intomainfrom
POC/chat_from_github_issues

Conversation

@parjong
Copy link
Owner

@parjong parjong commented Dec 5, 2025

@parjong

This comment was marked as outdated.

@parjong

This comment was marked as outdated.

@parjong parjong force-pushed the POC/chat_from_github_issues branch 4 times, most recently from a6e8e1b to b9cea1a Compare December 5, 2025 02:40
@parjong parjong changed the title Chat from Github Issue PoC: Chat from Github Issue Dec 5, 2025
if 'CI' in environ:
sample = """Hello! I'm Alex, your friendly AI assistant here to help you with whatever you need! 😊"""
return sample
# if/ END
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

일단은 CI 통합까지 진행해보기 위해서 간단한 샘플 답변을 하드코딩해두었다.


repository = 'parjong/prototype'
src_issue_number = 13 # Q. Github DOES NOT distinguish Issue/Pull Request
dst_issue_number = 14
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Workflow가 issue_comment event로 trigger된 경우 github.contexthttps://docs.github.com/en/webhooks/webhook-events-and-payloads#issue_comment 에 있는 schema를 따른다

그러면 github.context.issue.number를 통해서 해당 comment가 소속된 issue를 알 수 있다.

issue_number를 그 값으로 설정하면 된다 (물론 string -> int 변환은 필요)

# - As system prompt?
# - As chat history?
messages += [ { 'role': 'user', 'content': issue.body } ]
messages += [ chat_message_of_(comment) for comment in issue.get_comments() ]
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

근데, Chat GPT의 경우 단일 사용자와 에이전트와의 대화인데... Github Issue에는 다중 사용자가 올 수 있는데 이걸 구분할 방법이 있나?

"role" 만으로는 정보가 좀 부족한 것 같은데 🤔

@parjong
Copy link
Owner Author

parjong commented Dec 5, 2025

위 답변들은 실제 qwen3:1.7b 모델을 활용해서 생성한 결과이다.

## Probeles to Solve

1. How to test workflows?
- Espeically workflows with ``issue_comment`` trigger
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

사내에서 개인 인프라 구축하다가 겪었던 문제 😭

일단 현재 생각나는 방안은 context를 .json으로 저장한 다음에 이용하는 방식으로 workflow를 작성하고, workflow 자체를 테스트 할 때는 사전에 준비된 fixture (repo에 commit 하거나 혹은 gist를 통해서 전달하거나)를 이용해서 테스트를 하면 되지 않을까? 싶긴하다.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue_comment workflow에서 알아내야 하는 정보

  • issue.number

@parjong parjong force-pushed the POC/chat_from_github_issues branch from b9cea1a to 0fedb47 Compare December 5, 2025 04:20
@parjong parjong closed this Dec 5, 2025
@parjong parjong reopened this Dec 5, 2025
@parjong parjong force-pushed the POC/chat_from_github_issues branch from 0fedb47 to a91558c Compare December 5, 2025 04:22
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

Hello! I'm Alex, your friendly AI assistant here to help you with whatever you need! 😊

@parjong parjong force-pushed the POC/chat_from_github_issues branch from a91558c to 298e9d0 Compare December 5, 2025 04:23
@github-actions
Copy link

github-actions bot commented Dec 5, 2025

Hello! I'm Alex, your friendly AI assistant here to help you with whatever you need! 😊

@parjong parjong force-pushed the POC/chat_from_github_issues branch 2 times, most recently from 9956d4d to 08a0d43 Compare December 5, 2025 04:39
Let's check requirements!

[ci skip]

Signed-off-by: Jonghyun Park <parjong@gmail.com>
@parjong parjong force-pushed the POC/chat_from_github_issues branch from 08a0d43 to 112ace6 Compare December 5, 2025 04:42
@parjong
Copy link
Owner Author

parjong commented Dec 5, 2025

로컬 환경에서 uv run chat-from-github-issue을 수행하면 다음과 같이 출력이 나온다.

Messages:
[{'content': 'You are alex, a kind assistant', 'role': 'system'},
 {'content': '### What?\n'
             '\n'
             'The goal of this task is  to do something\n'
             '\n'
             '### Why?\n'
             '\n'
             'It is necessary for some reason 😄 ',
  'role': 'user'},
 {'content': 'alex, could you please introduce yourself?\n', 'role': 'user'},
 {'content': "Hello! I'm Alex, your friendly AI assistant here to help you "
             'with whatever you need! 😊',
  'role': 'assistant'}]
Response:


I'm here to assist you with various tasks, answer questions, provide information, and more. Whether you need help with homework, technical issues, or just want to chat, I'm here to support you.

If you have any questions or need assistance, feel free to ask! Have a great day!
</think>

Hello! I'm Alex, your friendly AI assistant here to help you with whatever you need! 😊

I'm here to assist you with various tasks, answer questions, provide information, and more. Whether you need help with homework, technical issues, or just want to chat, I'm here to support you.

If you have any questions or need assistance, feel free to ask! Have a great day!

4번째 turn을 보면 roleassistant로 잘 지정되어 있는 것을 볼 수 있다.

- Ollama (in use)
- https://github.com/ollama/ollama-python
- Gemini (candidate)
- https://ai.google.dev/gemini-api/docs
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gemini의 Multi-turn Chat API을 잠시 살펴봤는데, 세션 자체를 API 뒤에서 유지하는 형태인 것 같다.

해서 ollama와 같은 방식을 사용은 어렵다.

아니면,, 매번 새로운 chat을 만드는 방법이 있긴한데 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant