<commit_before>﻿module FotM.Apollo.ChatModule

open Microsoft.AspNet.SignalR
open Microsoft.AspNet.SignalR.Hubs
open EkonBenefits.FSharp.Dynamic
open FotM.Hephaestus.Async
open FotM.Data
open FotM.Hephaestus.TraceLogging

type ChatAvatar = ChatAvatar of Race * Gender * Class

let allAvatars = 
    [
        for race in Races.all do 
        for c in Classes.all do // TODO: restrict classes to those playable for race
        for gender in Genders.all do
        yield ChatAvatar(race, gender, c)
    ] |> Set.ofList

let maxMessageLength = 140
let maxMessages = 5

type Room = Room of string
type ChatMessage = ChatMessage of string
type User = User of string
type UserAvatar = UserAvatar of User * ChatAvatar

let getRoomName(Room name) = name

type ChatEvent =
| UserJoined of Room*User
| UserLeft of Room*User
| UserDisconnected of User
| MessageAdded of Room*User*ChatMessage

type ChatRoomEvent =
| UserJoinedRoom of User
| UserLeftRoom of User
| MessageAddedToRoom of User*ChatMessage
| UserDisconnectedFromRoom of User

let startAgent<'Message> processMessage = Agent<'Message>.Start(fun mailbox ->
    let rec loop() = async {
        let! msg = mailbox.Receive()<commit_msg>Adjusted max number of messages in chat.<commit_after>﻿module FotM.Apollo.ChatModule

open Microsoft.AspNet.SignalR
open Microsoft.AspNet.SignalR.Hubs
open EkonBenefits.FSharp.Dynamic
open FotM.Hephaestus.Async
open FotM.Data
open FotM.Hephaestus.TraceLogging

type ChatAvatar = ChatAvatar of Race * Gender * Class

let allAvatars = 
    [
        for race in Races.all do 
        for c in Classes.all do // TODO: restrict classes to those playable for race
        for gender in Genders.all do
        yield ChatAvatar(race, gender, c)
    ] |> Set.ofList

let maxMessageLength = 140
let maxMessages = 100

type Room = Room of string
type ChatMessage = ChatMessage of string
type User = User of string
type UserAvatar = UserAvatar of User * ChatAvatar

let getRoomName(Room name) = name

type ChatEvent =
| UserJoined of Room*User
| UserLeft of Room*User
| UserDisconnected of User
| MessageAdded of Room*User*ChatMessage

type ChatRoomEvent =
| UserJoinedRoom of User
| UserLeftRoom of User
| MessageAddedToRoom of User*ChatMessage
| UserDisconnectedFromRoom of User

let startAgent<'Message> processMessage = Agent<'Message>.Start(fun mailbox ->
    let rec loop() = async {
        let! msg = mailbox.Receive()
{'fraction_non_alphanumeric': 0.0687213660974594, 'fraction_numerical': 0.004164931278633903, 'mean_word_length': 3.9628099173553717, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4082272', 'n_tokens_mistral': 762, 'n_tokens_neox': 739, 'n_words': 249}